Skip to content

Commit 4d72ba7

Browse files
committed
docs(auth): mention TOTP official docs in MFA usage page
1 parent 2bee8c8 commit 4d72ba7

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

.spellcheck.dict.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ TFUA
198198
thenable
199199
ThreadPoolExecutor
200200
timezones
201+
TOTP
201202
triaging
202203
TurboModule
203204
TurboModules

docs/auth/multi-factor-auth.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,24 @@ next: /firestore/usage
55
previous: /auth/oidc-auth
66
---
77

8-
# iOS Setup
8+
> Before a user can enroll a second factor they need to verify their email. See
9+
> [`User`](/reference/auth/user#sendEmailVerification) interface is returned.
10+
11+
# TOTP MFA
12+
13+
The [official guide for Firebase web TOTP authentication](https://firebase.google.com/docs/auth/web/totp-mfa) explains the TOTP process well, including project prerequisites to enable the feature, as well as code examples.
14+
15+
The API details and usage examples may be combined with the full Phone auth example below to give you an MFA solution that fully supports TOTP or SMS MFA.
16+
17+
# Phone MFA
18+
19+
## iOS Setup
920

1021
Make sure to follow [the official Identity Platform
1122
documentation](https://cloud.google.com/identity-platform/docs/ios/mfa#enabling_multi-factor_authentication)
1223
to enable multi-factor authentication for your project and verify your app.
1324

14-
# Enroll a new factor
15-
16-
> Before a user can enroll a second factor they need to verify their email. See
17-
> [`User`](/reference/auth/user#sendEmailVerification) interface is returned.
25+
## Enroll a new factor
1826

1927
Begin by obtaining a [`MultiFactorUser`](/reference/auth/multifactoruser)
2028
instance for the current user. This is the entry point for most multi-factor
@@ -57,7 +65,7 @@ await multiFactorUser.enroll(multiFactorAssertion, 'Optional display name for th
5765
You can inspect [`User#multiFactor`](/reference/auth/user#multiFactor) for
5866
information about the user's enrolled factors.
5967

60-
# Sign-in flow using multi-factor
68+
## Sign-in flow using phone multi-factor
6169

6270
Ensure the account has already enrolled a second factor. Begin by calling the
6371
default sign-in methods, for example email and password. If the account requires
@@ -103,7 +111,6 @@ if (resolver.hints.length > 1) {
103111
// Use resolver.hints to display a list of second factors to the user
104112
}
105113

106-
// Currently only phone based factors are supported
107114
if (resolver.hints[0].factorId === PhoneMultiFactorGenerator.FACTOR_ID) {
108115
// Continue with the sign-in flow
109116
}
@@ -163,7 +170,6 @@ signInWithEmailAndPassword(getAuth(), email, password)
163170
// Use resolver.hints to display a list of second factors to the user
164171
}
165172

166-
// Currently only phone based factors are supported
167173
if (resolver.hints[0].factorId === PhoneMultiFactorGenerator.FACTOR_ID) {
168174
const hint = resolver.hints[0];
169175

@@ -185,7 +191,7 @@ signInWithEmailAndPassword(getAuth(), email, password)
185191
});
186192
```
187193

188-
# Testing
194+
## Testing
189195

190196
You can define test phone numbers and corresponding verification codes. The
191197
official[official

0 commit comments

Comments
 (0)