You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// A challenge that the authenticator signs, along with other data, when producing an authentication assertion
22
+
/// A challenge that the authenticator signs, along with other data, when producing an authentication assertion.
23
23
///
24
24
/// When encoding using `Encodable` this is encoded as base64url.
25
25
publicvarchallenge:[UInt8]
@@ -45,6 +45,16 @@ public struct PublicKeyCredentialRequestOptions: Sendable {
45
45
46
46
// let extensions: [String: Any]
47
47
48
+
/// Initialize a credential request options dictionary directly.
49
+
///
50
+
/// - Warning: Manually initializing options dictionaries can easily lead to insecure implementations of the WebAuthn protocol. Whenever possible, create a options dictionary using ``WebAuthnManager/beginAuthentication(timeout:allowCredentials:userVerification:)`` instead.
51
+
///
52
+
/// - Parameters:
53
+
/// - challenge: A challenge that the authenticator signs, along with other data, when producing an authentication assertion.
54
+
/// - timeout: A time, in seconds, that the caller is willing to wait for the call to complete. This is treated as a hint, and may be overridden by the client.
55
+
/// - relyingPartyID: The ID of the Relying Party making the request.
56
+
/// - allowCredentials: Optionally used by the client to find authenticators eligible for this authentication ceremony.
57
+
/// - userVerification: Specifies whether the user should be verified during the authentication ceremony.
/// Initialize a credential creation options dictionary directly.
48
+
///
49
+
/// - Warning: Manually initializing options dictionaries can easily lead to insecure implementations of the WebAuthn protocol. Whenever possible, create a options dictionary using ``WebAuthnManager/beginRegistration(user:timeout:attestation:publicKeyCredentialParameters:)`` instead.
50
+
///
51
+
/// - Parameters:
52
+
/// - challenge: A byte array randomly generated by the Relying Party. Should be at least 16 bytes long to ensure sufficient entropy.
53
+
/// - user: Contains names and an identifier for the user account performing the registration.
54
+
/// - relyingParty: Contains a name and an identifier for the Relying Party responsible for the request.
55
+
/// - publicKeyCredentialParameters: A list of key types and signature algorithms the Relying Party supports. Ordered from most preferred to least preferred.
56
+
/// - timeout: A time, in seconds, that the caller is willing to wait for the call to complete. This is treated as a hint, and may be overridden by the client.
57
+
/// - attestation: Sets the Relying Party's preference for attestation conveyance. At the time of writing only `none` is supported.
Copy file name to clipboardExpand all lines: Sources/WebAuthn/WebAuthnManager.swift
+7-2Lines changed: 7 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,10 @@ public struct WebAuthnManager: Sendable {
46
46
47
47
/// Generate a new set of registration data to be sent to the client.
48
48
///
49
-
/// This method will use the Relying Party information from the WebAuthnManager's configuration to create ``PublicKeyCredentialCreationOptions``
49
+
/// This method will use the Relying Party information from the WebAuthnManager's configuration to create a ready-to-consume ``PublicKeyCredentialCreationOptions`` on the client.
50
+
///
51
+
/// - Important: You must store the ``PublicKeyCredentialCreationOptions/challenge`` value returned by this method and validate against it during the ``finishRegistration(challenge:credentialCreationData:requireUserVerification:supportedPublicKeyAlgorithms:pemRootCertificatesByFormat:confirmCredentialIDNotRegisteredYet:)`` phase of registration.
52
+
///
50
53
/// - Parameters:
51
54
/// - user: The user to register.
52
55
/// - timeout: How long the browser should give the user to choose an authenticator. This value
@@ -126,7 +129,9 @@ public struct WebAuthnManager: Sendable {
126
129
)
127
130
}
128
131
129
-
/// Generate options for retrieving a credential via navigator.credentials.get()
132
+
/// Generate options for retrieving a credential via `navigator.credentials.get()`.
133
+
///
134
+
/// - Important: You must store the ``PublicKeyCredentialRequestOptions/challenge`` value returned by this method and validate against it during the ``finishAuthentication(credential:expectedChallenge:credentialPublicKey:credentialCurrentSignCount:requireUserVerification:)`` phase of authentication.
130
135
///
131
136
/// - Parameters:
132
137
/// - timeout: How long the browser should give the user to choose an authenticator. This value
0 commit comments