@@ -44,8 +44,8 @@ You just need to include the following script and CSS file in the `<head>` tag
44
44
of your page, below the initialization snippet from the Firebase Console:
45
45
46
46
``` html
47
- <script src =" https://cdn.firebase.com/libs/firebaseui/1 .0.1 /firebaseui.js" ></script >
48
- <link type =" text/css" rel =" stylesheet" href =" https://cdn.firebase.com/libs/firebaseui/1 .0.1 /firebaseui.css" />
47
+ <script src =" https://cdn.firebase.com/libs/firebaseui/2 .0.0 /firebaseui.js" ></script >
48
+ <link type =" text/css" rel =" stylesheet" href =" https://cdn.firebase.com/libs/firebaseui/2 .0.0 /firebaseui.css" />
49
49
```
50
50
51
51
### npm Module
@@ -92,13 +92,14 @@ the files within `bower_components/`:
92
92
FirebaseUI includes the following flows:
93
93
94
94
1 . Interaction with Identity Providers such as Google and Facebook
95
- 2 . Sign-up and sign-in with email accounts
96
- 3 . Password reset
97
- 4 . Prevention of account duplication (activated when
95
+ 2 . Phone number based authentication
96
+ 3 . Sign-up and sign-in with email accounts
97
+ 4 . Password reset
98
+ 5 . Prevention of account duplication (activated when
98
99
* "One account per email address"* setting is enabled in the
99
100
[ Firebase console] ( https://console.firebase.google.com ) . This setting is enabled
100
101
by default.)
101
- 5 . [ Account Chooser] ( https://www.accountchooser.com/learnmore.html?lang=en ) for
102
+ 6 . [ Account Chooser] ( https://www.accountchooser.com/learnmore.html?lang=en ) for
102
103
remembering emails
103
104
104
105
### Configuring sign-in providers
@@ -107,6 +108,7 @@ To use FirebaseUI to authenticate users you first need to configure each
107
108
provider you want to use in their own developer app settings. Please read the
108
109
* Before you begin* section of Firebase Authentication at the following links:
109
110
111
+ - [ Phone number] ( https://firebase.google.com/docs/auth/web/phone-auth )
110
112
- [ Email and password] ( https://firebase.google.com/docs/auth/web/password-auth#before_you_begin )
111
113
- [ Google] ( https://firebase.google.com/docs/auth/web/google-signin#before_you_begin )
112
114
- [ Facebook] ( https://firebase.google.com/docs/auth/web/facebook-login#before_you_begin )
@@ -139,8 +141,8 @@ for a more in-depth example, showcasing a Single Page Application mode.
139
141
* TODO(DEVELOPER): Paste the initialization snippet from:
140
142
* Firebase Console > Overview > Add Firebase to your web app. *
141
143
***************************************************************************************** -->
142
- <script src =" https://cdn.firebase.com/libs/firebaseui/1 .0.1 /firebaseui.js" ></script >
143
- <link type =" text/css" rel =" stylesheet" href =" https://cdn.firebase.com/libs/firebaseui/1 .0.1 /firebaseui.css" />
144
+ <script src =" https://cdn.firebase.com/libs/firebaseui/2 .0.0 /firebaseui.js" ></script >
145
+ <link type =" text/css" rel =" stylesheet" href =" https://cdn.firebase.com/libs/firebaseui/2 .0.0 /firebaseui.css" />
144
146
<script type =" text/javascript" >
145
147
// FirebaseUI config.
146
148
var uiConfig = {
@@ -151,7 +153,8 @@ for a more in-depth example, showcasing a Single Page Application mode.
151
153
firebase .auth .FacebookAuthProvider .PROVIDER_ID ,
152
154
firebase .auth .TwitterAuthProvider .PROVIDER_ID ,
153
155
firebase .auth .GithubAuthProvider .PROVIDER_ID ,
154
- firebase .auth .EmailAuthProvider .PROVIDER_ID
156
+ firebase .auth .EmailAuthProvider .PROVIDER_ID ,
157
+ firebase .auth .PhoneAuthProvider .PROVIDER_ID
155
158
],
156
159
// Terms of service url.
157
160
tosUrl: ' <your-tos-url>'
@@ -194,6 +197,7 @@ Here is how you would track the Auth state across all your pages:
194
197
var emailVerified = user .emailVerified ;
195
198
var photoURL = user .photoURL ;
196
199
var uid = user .uid ;
200
+ var phoneNumber = user .phoneNumber ;
197
201
var providerData = user .providerData ;
198
202
user .getToken ().then (function (accessToken ) {
199
203
document .getElementById (' sign-in-status' ).textContent = ' Signed in' ;
@@ -202,6 +206,7 @@ Here is how you would track the Auth state across all your pages:
202
206
displayName: displayName,
203
207
email: email,
204
208
emailVerified: emailVerified,
209
+ phoneNumber: phoneNumber,
205
210
photoURL: photoURL,
206
211
uid: uid,
207
212
accessToken: accessToken,
@@ -355,6 +360,7 @@ specifying the value below.
355
360
| Twitter | ` firebase.auth.TwitterAuthProvider.PROVIDER_ID ` |
356
361
| Github | ` firebase.auth.GithubAuthProvider.PROVIDER_ID ` |
357
362
| Email and password| ` firebase.auth.EmailAuthProvider.PROVIDER_ID ` |
363
+ | Phone number | ` firebase.auth.PhoneAuthProvider.PROVIDER_ID ` |
358
364
359
365
### Custom scopes
360
366
@@ -400,6 +406,29 @@ ui.start('#firebaseui-auth-container', {
400
406
});
401
407
```
402
408
409
+ ### Configure Phone Provider
410
+
411
+ The ` PhoneAuthProvider ` can be configured with custom reCAPTCHA parameters
412
+ whether reCAPTCHA is visible or invisible (defaults to ` normal ` ). Refer to the
413
+ [ reCAPTCHA API docs] ( https://developers.google.com/recaptcha/docs/display ) for
414
+ more details. The following options are currently supported. Any other
415
+ parameters will be ignored.
416
+
417
+ ``` javascript
418
+ ui .start (' #firebaseui-auth-container' , {
419
+ signInOptions = [
420
+ {
421
+ provider: firebase .auth .PhoneAuthProvider .PROVIDER_ID ,
422
+ recaptchaParameters: {
423
+ type: ' image' , // 'audio'
424
+ size: ' normal' , // 'invisible' or 'compact'
425
+ badge: ' bottomleft' // ' bottomright' or 'inline' applies to invisible.
426
+ }
427
+ }
428
+ ]
429
+ });
430
+ ```
431
+
403
432
### Sign In Flows
404
433
405
434
Two sign in flows are available:
@@ -453,8 +482,8 @@ FirebaseUI is displayed.
453
482
* TODO(DEVELOPER): Paste the initialization snippet from:
454
483
* Firebase Console > Overview > Add Firebase to your web app. *
455
484
***************************************************************************************** -->
456
- <script src =" https://cdn.firebase.com/libs/firebaseui/1 .0.1 /firebaseui.js" ></script >
457
- <link type =" text/css" rel =" stylesheet" href =" https://cdn.firebase.com/libs/firebaseui/1 .0.1 /firebaseui.css" />
485
+ <script src =" https://cdn.firebase.com/libs/firebaseui/2 .0.0 /firebaseui.js" ></script >
486
+ <link type =" text/css" rel =" stylesheet" href =" https://cdn.firebase.com/libs/firebaseui/2 .0.0 /firebaseui.css" />
458
487
<script type =" text/javascript" >
459
488
// FirebaseUI config.
460
489
var uiConfig = {
@@ -488,6 +517,15 @@ FirebaseUI is displayed.
488
517
provider: firebase .auth .EmailAuthProvider .PROVIDER_ID ,
489
518
// Whether the display name should be displayed in the Sign Up page.
490
519
requireDisplayName: true
520
+ },
521
+ {
522
+ provider: firebase .auth .PhoneAuthProvider .PROVIDER_ID ,
523
+ // Invisible reCAPTCHA with image challenge and bottom left badge.
524
+ recaptchaParameters: {
525
+ type: ' image' ,
526
+ size: ' invisible' ,
527
+ badge: ' bottomleft'
528
+ }
491
529
}
492
530
],
493
531
// Terms of service url.
0 commit comments