@@ -367,17 +367,86 @@ FirebaseUI supports the following configuration parameters.
367
367
368
368
The role of a credential helper is to help your users sign into you website.
369
369
When one is enabled, your users will be prompted with email addresses and
370
- usernames they have saved from your app or other applications. To achieve this,
371
- [ accountchooser.com] ( https://www.accountchooser.com/learnmore.html ) is
372
- available. Upon signing in or signing up with email, the user will be redirected
373
- to the accountchooser.com website and will be able to select one of their saved
374
- accounts. It is recommended to use this, but you can also disable it by
375
- specifying the value below. This feature is always disabled for non HTTP/HTTPS
376
- environments.
370
+ usernames they have saved from your app or other applications.
371
+ FirebaseUI supports the following credential helpers:
372
+
373
+ - [ one-tap sign-up] ( https://developers.google.com/identity/one-tap/web/overview )
374
+ - [ accountchooser.com] ( https://www.accountchooser.com/learnmore.html )
375
+
376
+ #### accountchooser.com
377
+
378
+ When [ accountchooser.com] ( https://www.accountchooser.com/learnmore.html ) is
379
+ enabled (enabled by default), upon signing in or
380
+ signing up with email, the user will be redirected to the accountchooser.com
381
+ website and will be able to select one of their saved accounts. You can
382
+ disable it by specifying the value below. This feature is always disabled for
383
+ non HTTP/HTTPS environments.
384
+
385
+ #### One-tap sign-up
386
+
387
+ [ One-tap sign-up] ( https://developers.google.com/identity/one-tap/web/overview )
388
+ provides seamless authentication flows to
389
+ your users with Google's one tap sign-up and automatic sign-in APIs.
390
+ With one tap sign-up, users are prompted to create an account with a dialog
391
+ that's inline with FirebaseUI NASCAR screen. With just one tap, they get a
392
+ secure, token-based, passwordless account with your service, protected by their
393
+ Google Account. As the process is frictionless, users are much more likely to
394
+ register.
395
+ Returning users are signed in automatically, even when they switch devices or
396
+ platforms, or after their session expires.
397
+ One-tap sign-up integrates with FirebaseUI and if you request Google OAuth
398
+ scopes, you will still get back the expected Google OAuth access token even if
399
+ the user goes through the one-tap flow. However, in that case 'redirect' flow is
400
+ always used even when 'popup' is specified.
401
+ In addition, if you choose to force prompt for Google sign-in, one-tap auto
402
+ sign-in will be automatically disabled.
403
+ One-tap is an additive feature and is only supported in the latest evergreen
404
+ modern browser environments.
405
+ For more information on how to configure one-tap sign-up, refer to the
406
+ [ one-tap get started guide] ( https://developers.google.com/identity/one-tap/web/get-started ) .
407
+
408
+ The following example shows how to configure one-tap sign-up with FirebaseUI.
409
+ Along with the corresponding one-tap ` credentialHelper ` , ` clientId ` and
410
+ ` authMethod ` have to be provided with the Firebase Google provider:
411
+
412
+ ``` javascript
413
+ ui .start (' #firebaseui-auth-container' , {
414
+ signInOptions = [
415
+ {
416
+ // Google provider must be enabled in Firebase Console to support one-tap
417
+ // sign-up.
418
+ provider: firebase .auth .GoogleAuthProvider .PROVIDER_ID ,
419
+ // Required to enable this provider in one-tap sign-up.
420
+ authMethod: ' https://accounts.google.com' ,
421
+ // Required to enable ID token credentials for this provider.
422
+ // This can be obtained from the Credentials page of the Google APIs
423
+ // console.
424
+ clientId: ' xxxxxxxxxxxxxxxxx.apps.googleusercontent.com'
425
+ },
426
+ firebase .auth .FacebookAuthProvider .PROVIDER_ID ,
427
+ firebase .auth .TwitterAuthProvider .PROVIDER_ID ,
428
+ firebase .auth .GithubAuthProvider .PROVIDER_ID ,
429
+ firebase .auth .EmailAuthProvider .PROVIDER_ID ,
430
+ ],
431
+ // Required to enable one-tap sign-up credential helper.
432
+ credentialHelper: firebaseui .auth .CredentialHelper .GOOGLE_YOLO
433
+ });
434
+ // Auto sign-in for returning users is enabled by default except when prompt is
435
+ // not 'none' in the Google provider custom parameters. To manually disable:
436
+ ui .disableAutoSignIn ();
437
+ ```
438
+
439
+ Auto sign-in for returning users can be disabled by calling
440
+ ` ui.disableAutoSignIn() ` . This may be needed if the FirebaseUI sign-in page is
441
+ being rendered after the user signs out.
442
+
443
+ To see FirebaseUI in action with one-tap sign-up, check out the FirebaseUI
444
+ [ demo app] ( https://fir-ui-demo-84a6c.firebaseapp.com/ ) .
377
445
378
446
| Credential Helper | Value |
379
447
| ------------------| ------------------------------------------------------|
380
448
| accountchooser.com| ` firebaseui.auth.CredentialHelper.ACCOUNT_CHOOSER_COM ` |
449
+ | One-tap sign-up | ` firebaseui.auth.CredentialHelper.GOOGLE_YOLO ` |
381
450
| None (disable) | ` firebaseui.auth.CredentialHelper.NONE ` |
382
451
383
452
### Available providers
0 commit comments