@@ -21,9 +21,10 @@ FirebaseUI Auth clients are also available for
2121[ Android] ( https://github.com/firebase/firebaseui-android ) .
2222
2323FirebaseUI fully supports all recent browsers. Signing in with federated
24- providers (Google, Facebook, Twitter, Github) is not yet supported in
25- non-browser environments (Cordova, React Native, Ionic...) nor Chrome
26- extensions.
24+ providers (Google, Facebook, Twitter, Github) is also supported in
25+ Cordova/Ionic environments. Additional non-browser environments (React
26+ Native...) or Chrome extensions will be added once the underlying Firebase core
27+ SDK supports them in a way that is compatible with FirebaseUI.
2728
2829## Table of Contents
2930
@@ -34,8 +35,9 @@ extensions.
34355 . [ Customization] ( #customizing-firebaseui-for-authentication )
35366 . [ Advanced] ( #advanced )
36377 . [ Developer Setup] ( #developer-setup )
37- 8 . [ Known issues] ( #known-issues )
38- 9 . [ Release Notes] ( #release-notes )
38+ 8 . [ Cordova Setup] ( #cordova-setup )
39+ 9 . [ Known issues] ( #known-issues )
40+ 10 . [ Release Notes] ( #release-notes )
3941
4042## Demo
4143
@@ -50,8 +52,8 @@ You just need to include the following script and CSS file in the `<head>` tag
5052of your page, below the initialization snippet from the Firebase Console:
5153
5254``` html
53- <script src =" https://cdn.firebase.com/libs/firebaseui/2.0 .0/firebaseui.js" ></script >
54- <link type =" text/css" rel =" stylesheet" href =" https://cdn.firebase.com/libs/firebaseui/2.0 .0/firebaseui.css" />
55+ <script src =" https://cdn.firebase.com/libs/firebaseui/2.1 .0/firebaseui.js" ></script >
56+ <link type =" text/css" rel =" stylesheet" href =" https://cdn.firebase.com/libs/firebaseui/2.1 .0/firebaseui.css" />
5557```
5658
5759### Option 2: npm Module
@@ -147,8 +149,8 @@ for a more in-depth example, showcasing a Single Page Application mode.
147149 * TODO(DEVELOPER): Paste the initialization snippet from:
148150 * Firebase Console > Overview > Add Firebase to your web app. *
149151 ***************************************************************************************** -->
150- <script src =" https://cdn.firebase.com/libs/firebaseui/2.0 .0/firebaseui.js" ></script >
151- <link type =" text/css" rel =" stylesheet" href =" https://cdn.firebase.com/libs/firebaseui/2.0 .0/firebaseui.css" />
152+ <script src =" https://cdn.firebase.com/libs/firebaseui/2.1 .0/firebaseui.js" ></script >
153+ <link type =" text/css" rel =" stylesheet" href =" https://cdn.firebase.com/libs/firebaseui/2.1 .0/firebaseui.css" />
152154 <script type =" text/javascript" >
153155 // FirebaseUI config.
154156 var uiConfig = {
@@ -350,7 +352,8 @@ usernames they have saved from your app or other applications. To achieve this,
350352available. Upon signing in or signing up with email, the user will be redirected
351353to the accountchooser.com website and will be able to select one of their saved
352354accounts. It is recommended to use this, but you can also disable it by
353- specifying the value below.
355+ specifying the value below. This feature is always disabled for non HTTP/HTTPS
356+ environments.
354357
355358| Credential Helper | Value |
356359| ------------------| ------------------------------------------------------|
@@ -368,10 +371,10 @@ specifying the value below.
368371| Email and password| ` firebase.auth.EmailAuthProvider.PROVIDER_ID ` |
369372| Phone number | ` firebase.auth.PhoneAuthProvider.PROVIDER_ID ` |
370373
371- ### Custom scopes
374+ ### Configure OAuth providers
372375
373- To specify custom scopes per provider, you can pass an object instead of just
374- the provider value:
376+ To specify custom scopes, or custom OAuth parameters per provider, you can pass
377+ an object instead of just the provider value:
375378
376379``` javascript
377380ui .start (' #firebaseui-auth-container' , {
@@ -380,7 +383,12 @@ ui.start('#firebaseui-auth-container', {
380383 provider: firebase .auth .GoogleAuthProvider .PROVIDER_ID ,
381384 scopes: [
382385 ' https://www.googleapis.com/auth/plus.login'
383- ]
386+ ],
387+ customParameters: {
388+ // Forces account selection even when one account
389+ // is available.
390+ prompt: ' select_account'
391+ }
384392 },
385393 {
386394 provider: firebase .auth .FacebookAuthProvider .PROVIDER_ID ,
@@ -389,7 +397,11 @@ ui.start('#firebaseui-auth-container', {
389397 ' email' ,
390398 ' user_likes' ,
391399 ' user_friends'
392- ]
400+ ],
401+ customParameters: {
402+ // Forces password re-entry.
403+ auth_type: ' reauthenticate'
404+ }
393405 },
394406 firebase .auth .TwitterAuthProvider .PROVIDER_ID , // Twitter does not support scopes.
395407 firebase .auth .EmailAuthProvider .PROVIDER_ID // Other providers don't need to be given as object.
@@ -417,7 +429,13 @@ ui.start('#firebaseui-auth-container', {
417429The ` PhoneAuthProvider ` can be configured with custom reCAPTCHA parameters
418430whether reCAPTCHA is visible or invisible (defaults to ` normal ` ). Refer to the
419431[ reCAPTCHA API docs] ( https://developers.google.com/recaptcha/docs/display ) for
420- more details. The following options are currently supported. Any other
432+ more details.
433+
434+ The default country to select in the phone number input can also be set.
435+ [ List of supported country codes] ( javascript/data/README.md ) . If unspecified,
436+ the phone number input will default to the United States (+1).
437+
438+ The following options are currently supported. Any other
421439parameters will be ignored.
422440
423441``` javascript
@@ -429,7 +447,8 @@ ui.start('#firebaseui-auth-container', {
429447 type: ' image' , // 'audio'
430448 size: ' normal' , // 'invisible' or 'compact'
431449 badge: ' bottomleft' // ' bottomright' or 'inline' applies to invisible.
432- }
450+ },
451+ defaultCountry: ' GB' // Set default country to the United Kingdom (+44).
433452 }
434453 ]
435454});
@@ -488,8 +507,8 @@ FirebaseUI is displayed.
488507 * TODO(DEVELOPER): Paste the initialization snippet from:
489508 * Firebase Console > Overview > Add Firebase to your web app. *
490509 ***************************************************************************************** -->
491- <script src =" https://cdn.firebase.com/libs/firebaseui/2.0 .0/firebaseui.js" ></script >
492- <link type =" text/css" rel =" stylesheet" href =" https://cdn.firebase.com/libs/firebaseui/2.0 .0/firebaseui.css" />
510+ <script src =" https://cdn.firebase.com/libs/firebaseui/2.1 .0/firebaseui.js" ></script >
511+ <link type =" text/css" rel =" stylesheet" href =" https://cdn.firebase.com/libs/firebaseui/2.1 .0/firebaseui.css" />
493512 <script type =" text/javascript" >
494513 // FirebaseUI config.
495514 var uiConfig = {
@@ -694,6 +713,47 @@ the other terminal that has the exported variables, run the tests:
694713npm test -- --saucelabs --tunnelIdentifier=< the tunnel identifier>
695714```
696715
716+ ## Cordova Setup
717+
718+ ### Introduction
719+
720+ FirebaseUI sign-in widget supports Cordova applications. This includes
721+ email/password and all OAuth providers (Google, Facebook, Twitter and GitHub).
722+ Phone authentication is not supported due to the limitation in the underlying
723+ Firebase core SDK.
724+
725+ ### Available providers
726+
727+ | Provider | Value |
728+ | ------------------| ------------------------------------------------|
729+ | Google | ` firebase.auth.GoogleAuthProvider.PROVIDER_ID ` |
730+ | Facebook | ` firebase.auth.FacebookAuthProvider.PROVIDER_ID ` |
731+ | Twitter | ` firebase.auth.TwitterAuthProvider.PROVIDER_ID ` |
732+ | Github | ` firebase.auth.GithubAuthProvider.PROVIDER_ID ` |
733+ | Email and password| ` firebase.auth.EmailAuthProvider.PROVIDER_ID ` |
734+
735+ ### Setup and Usage
736+
737+ In order to integrate FirebaseUI with your Cordova application, you need to
738+ follow these steps:
739+
740+ - Install the necessary Cordova plugins, make the necessary Firebase Console
741+ changes and update your config.xml file as documented in
742+ [ OAuth Sign-In for Cordova] ( https://firebase.google.com/docs/auth/web/cordova )
743+ - After you have successfully configured your application, you can use
744+ FirebaseUI in your Cordova application just like any other traditional browser
745+ applications.
746+
747+ Keep in mind the following while you set up the app:
748+ - Only ` redirect ` ` signInFlow ` is supported as Firebase Auth does not support
749+ ` popup ` mode for Cordova.
750+ - ` firebase.auth.PhoneAuthProvider.PROVIDER_ID ` is not currently supported.
751+ - As the application runs within an embedded webview, ` accountchooser.com ` will
752+ always be disabled.
753+ - If you are providing a ` Content-Security-Policy ` make sure you add the
754+ appropriate exceptions for FirebaseUI resources (` style-src ` , ` media-src ` ,
755+ ` img-src ` , ` script-src ` , etc.) and underlying Firebase JS SDK.
756+
697757## Known issues
698758
699759### Firebase Auth does not work in Safari private browsing
@@ -742,7 +802,7 @@ method of a React component), call the `reset` method of the
742802before rendering again the widget if one has already been rendered on the page.
743803Please refer to the [ demo app] ( demo/ ) for guidance on how to use FirebaseUI in a
744804Single Page Application context.
745- - ** Custom scopes** can now be added for each provider. See [ Custom Scopes ] ( custom-scopes ) .
805+ - ** Custom scopes** can now be added for each provider. See [ Configure OAuth providers ] ( configure-oauth-providers ) .
746806- Several issues, different but related to the ` displayName ` not being present
747807after sign up with email and password, have been fixed.
748808- A new config parameter has been added: ` signInFlow ` . It allows to specify
0 commit comments