Skip to content

Commit ed70791

Browse files
authored
Update README.md
1 parent c83236e commit ed70791

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ interface with a webpage that will handle calling the WebAuthn API:
4545
- `public typealias URLEncodedBase64 = String`
4646
- `public typealias EncodedBase64 = String`
4747

48-
### Example flow:
49-
50-
#### Setup
48+
### Setup
5149

5250
Configure your backend with a `WebAuthnManager` instance:
5351

@@ -62,11 +60,11 @@ app.webAuthn = WebAuthnManager(
6260
)
6361
```
6462

65-
#### Registration
63+
### Registration
6664

6765
Scenario: A user wants to signup on a website using WebAuthn.
6866

69-
##### Explanation
67+
#### Explanation
7068

7169
1. When tapping the "Register" button the client sends a request to
7270
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.
8381
generated challenge and the received `RegistrationCredential`. If `finishRegistration` succeeds a new `Credential`
8482
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.
8583

86-
##### Example implementation
84+
#### Example implementation
8785

8886
```swift
8987
authSessionRoutes.get("makeCredential") { req -> PublicKeyCredentialCreationOptions in
@@ -114,11 +112,11 @@ authSessionRoutes.post("makeCredential") { req -> HTTPStatus in
114112
}
115113
```
116114

117-
#### Authentication
115+
### Authentication
118116

119117
Scenario: A user wants to log in on a website using WebAuthn.
120118

121-
##### Explanation
119+
#### Explanation
122120

123121
1. When tapping the "Login" button the client sends a request to
124122
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.
142140
will return a `VerifiedAuthentication` with the updated sign count and a few other information meant to be persisted.
143141
Use this to update the credential in the database.
144142

145-
##### Implementation example
143+
#### Example implementation
146144

147145
```swift
148146
// this endpoint will be called on clicking "Login"
@@ -182,4 +180,4 @@ Swift WebAuthn is heavily inspired by existing WebAuthn libraries like [py_webau
182180
- [WebAuthn.io](https://webauthn.io/)
183181
- [WebAuthn guide](https://webauthn.guide/)
184182
- [WebAuthn Spec](https://w3c.github.io/webauthn/)
185-
- [CBOR.me](https://cbor.me/)
183+
- [CBOR.me](https://cbor.me/)

0 commit comments

Comments
 (0)