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
Scenario: A user wants to signup on a website using WebAuthn.
68
66
69
-
#####Explanation
67
+
#### Explanation
70
68
71
69
1. When tapping the "Register" button the client sends a request to
72
70
the backend. The backend responds to this request with a call to `begingRegistration(user:)` which then returns a
@@ -83,7 +81,7 @@ Scenario: A user wants to signup on a website using WebAuthn.
83
81
generated challenge and the received `RegistrationCredential`. If `finishRegistration` succeeds a new `Credential`
84
82
object will be returned. This object contains information about the new credential, including an id and the generated public-key. Persist this data in e.g. a database and link the entry to the user.
85
83
86
-
##### Example implementation
84
+
#### Example implementation
87
85
88
86
```swift
89
87
authSessionRoutes.get("makeCredential") { req -> PublicKeyCredentialCreationOptions in
@@ -114,11 +112,11 @@ authSessionRoutes.post("makeCredential") { req -> HTTPStatus in
114
112
}
115
113
```
116
114
117
-
####Authentication
115
+
### Authentication
118
116
119
117
Scenario: A user wants to log in on a website using WebAuthn.
120
118
121
-
#####Explanation
119
+
#### Explanation
122
120
123
121
1. When tapping the "Login" button the client sends a request to
124
122
the backend. The backend responds to this request with a call to `beginAuthentication()` which then in turn
@@ -142,7 +140,7 @@ Scenario: A user wants to log in on a website using WebAuthn.
142
140
will return a `VerifiedAuthentication` with the updated sign count and a few other information meant to be persisted.
143
141
Use this to update the credential in the database.
144
142
145
-
##### Implementation example
143
+
####Example implementation
146
144
147
145
```swift
148
146
// this endpoint will be called on clicking "Login"
@@ -182,4 +180,4 @@ Swift WebAuthn is heavily inspired by existing WebAuthn libraries like [py_webau
0 commit comments