Skip to content

Commit

Permalink
Update types for ID and Credential
Browse files Browse the repository at this point in the history
  • Loading branch information
mikenachbaur-okta committed Feb 22, 2024
1 parent bcc2f3c commit 77308f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extension WebAuthn {
*/
public struct PublicKeyCredentialDescriptor: Codable {
/// This member contains the credential ID of the public key credential the caller is referring to.
public let id: Data
public let id: String

/// This member contains the type of the public key credential the caller is referring to.
public let type: PublicKeyCredentialType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extension WebAuthn {
*/
public struct PublicKeyCredentialRequestOptions: Codable {
/// This member specifies a challenge that the authenticator signs, along with other data, when producing an authentication assertion. See the § 13.4.3 Cryptographic Challenges security consideration.
public let challenge: Data
public let challenge: String

/// Specifies the RP ID claimed by the Relying Party. The client MUST verify that the Relying Party's origin matches the scope of this RP ID. The authenticator MUST verify that this RP ID exactly equals the rpId of the credential to be used for the authentication ceremony.
public internal(set) var rpID: String?
Expand Down Expand Up @@ -54,7 +54,7 @@ extension WebAuthn {
let container = try decoder.container(keyedBy: CodingKeys.self)

allowCredentials = try container.decodeIfPresent([PublicKeyCredentialDescriptor].self, forKey: .allowCredentials)
challenge = try container.decode(Data.self, forKey: .challenge)
challenge = try container.decode(String.self, forKey: .challenge)
rpID = try container.decodeIfPresent(String.self, forKey: .rpID)
hints = try container.decodeIfPresent([PublicKeyCredentialHints].self, forKey: .hints)
userVerification = try container.decodeIfPresent(UserVerificationRequirement.self, forKey: .userVerification)
Expand Down

0 comments on commit 77308f8

Please sign in to comment.