Skip to content

Commit 42b218f

Browse files
Added basic client authentication ceremony
1 parent 5213fff commit 42b218f

File tree

4 files changed

+227
-109
lines changed

4 files changed

+227
-109
lines changed

Sources/WebAuthn/Ceremonies/Authentication/AuthenticationCredential.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,19 @@ public struct AuthenticationCredential: Sendable {
3333

3434
/// Value will always be ``CredentialType/publicKey`` (for now)
3535
public let type: CredentialType
36+
37+
init(
38+
type: CredentialType = .publicKey,
39+
id: [UInt8],
40+
authenticatorAttachment: AuthenticatorAttachment?,
41+
response: AuthenticatorAssertionResponse
42+
) {
43+
self.id = id.base64URLEncodedString()
44+
self.rawID = id
45+
self.response = response
46+
self.authenticatorAttachment = authenticatorAttachment
47+
self.type = type
48+
}
3649
}
3750

3851
extension AuthenticationCredential: Codable {

0 commit comments

Comments
 (0)