@@ -6,9 +6,9 @@ customizable UI bindings on top of the core
6
6
code and promote best practices (both user experience and security) for
7
7
authentication.
8
8
9
- A simple API is provided for drop-in user authentication which handles
10
- the flow of signing in users with Email/Password,
11
- Google Sign-In, and Facebook Login. It is built on top of the
9
+ A simple API is provided for drop-in user authentication which handles the flow
10
+ of signing in users with email addresses and passwords, and federated identity
11
+ providers such as Google Sign-In, and Facebook Login. It is built on top of
12
12
[ Firebase Auth] ( https://firebase.google.com/docs/auth ) .
13
13
14
14
The best practices embodied in FirebaseUI aim to maximize sign-in
@@ -67,7 +67,7 @@ these authentication methods are first configured in the Firebase console.
67
67
FirebaseUI client-side configuration for Google sign-in is then provided
68
68
automatically by the
69
69
[ google-services gradle plugin] ( https://developers.google.com/android/guides/google-services-plugin ) .
70
- If support for Facebook Sign-in is also required, define the
70
+ If support for Facebook Login is also required, define the
71
71
resource string ` facebook_application_id ` to match the application ID in
72
72
the [ Facebook developer dashboard] ( https://developers.facebook.com ) :
73
73
@@ -81,15 +81,15 @@ the [Facebook developer dashboard](https://developers.facebook.com):
81
81
```
82
82
83
83
If support for Twitter Sign-in is also required, define the resource strings
84
- twitter_consumer_key and twitter_consumer_secret to match the values of your Twitter app as
85
- reported by the [ Twitter application manager] ( https://dev.twitter.com/apps ) .
84
+ ` twitter_consumer_key ` and ` twitter_consumer_secret ` to match the values of your
85
+ Twitter app as reported by the
86
+ [ Twitter application manager] ( https://dev.twitter.com/apps ) .
86
87
87
88
```
88
89
<resources>
89
90
<string name="twitter_consumer_key" translatable="false">YOURCONSUMERKEY</string>
90
91
<string name="twitter_consumer_secret" translatable="false">YOURCONSUMERSECRET</string>
91
92
</resources>
92
-
93
93
```
94
94
95
95
## Using FirebaseUI for Authentication
@@ -112,13 +112,14 @@ The entry point to the authentication flow is the
112
112
If your application uses the default ` FirebaseApp ` instance, an AuthUI
113
113
instance can be retrieved simply by calling ` AuthUI.getInstance() ` .
114
114
If an alternative app instance is required, call
115
- ` AuthUI.getInstance(app) ` instead, passing the appropriate FirebaseApp instance.
115
+ ` AuthUI.getInstance(app) ` instead, passing the appropriate ` FirebaseApp `
116
+ instance.
116
117
117
118
### Sign in
118
119
119
120
If a user is not currently signed in, as can be determined by checking
120
- ` auth.getCurrentUser() != null ` , where auth is the FirebaseAuth instance
121
- associated with your FirebaseApp, then the sign-in process can be started by
121
+ ` auth.getCurrentUser() != null ` ( where ` auth ` is the ` FirebaseAuth ` instance
122
+ associated with your ` FirebaseApp ` ) , then the sign-in process can be started by
122
123
creating a sign-in intent using ` AuthUI.SignInIntentBuilder ` . A builder instance
123
124
can be retrieved by calling ` createSignInIntentBuilder() ` on the retrieved
124
125
AuthUI instance.
@@ -129,9 +130,8 @@ The builder provides the following customization options for the authentication
129
130
- The terms of service URL for your app can be specified, which is included as
130
131
a link in the small-print of the account creation step for new users. If no
131
132
terms of service URL is provided, the associated small-print is omitted.
132
-
133
133
- A custom theme can be specified for the flow, which is applied to all the
134
- activities in the flow for consistent customization of colors and typography.
134
+ activities in the flow for consistent colors and typography.
135
135
136
136
#### Sign-in examples
137
137
@@ -175,8 +175,8 @@ startActivityForResult(
175
175
176
176
By default, FirebaseUI uses [ Smart Lock for Passwords] ( https://developers.google.com/identity/smartlock-passwords/android/ )
177
177
to store the user's credentials and automatically sign users into your app on subsequent attempts.
178
- Using SmartLock is recommended to provide the best user experience, but in some cases you may want
179
- to disable SmartLock for testing or development. To disable SmartLock , you can use the
178
+ Using Smart Lock is recommended to provide the best user experience, but in some cases you may want
179
+ to disable Smart Lock for testing or development. To disable Smart Lock , you can use the
180
180
` setIsSmartLockEnabled ` method when building your sign-in Intent:
181
181
182
182
``` java
@@ -188,8 +188,8 @@ startActivityForResult(
188
188
RC_SIGN_IN );
189
189
```
190
190
191
- It is often desirable to disable SmartLock in development but enable it in production. To achieve
192
- this, you can use the ` BuildConfig.DEBUG ` flag to control SmartLock :
191
+ It is often desirable to disable Smart Lock in development but enable it in production. To achieve
192
+ this, you can use the ` BuildConfig.DEBUG ` flag to control Smart Lock :
193
193
194
194
``` java
195
195
startActivityForResult(
@@ -208,7 +208,7 @@ The authentication flow only provides three response codes:
208
208
sign in failed, and ` ResultCodes.RESULT_NO_NETWORK ` if sign in failed due to a lack of network connectivity.
209
209
No further information on failure is provided as it is not
210
210
typically useful; the only recourse for most apps if sign in fails is to ask
211
- the user to sign in again later, or proceed with an anonymous account if
211
+ the user to sign in again later, or proceed with anonymous sign-in if
212
212
supported.
213
213
214
214
``` java
@@ -221,7 +221,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
221
221
return ;
222
222
}
223
223
224
- // Sign in cancelled
224
+ // Sign in canceled
225
225
if (resultCode == RESULT_CANCELED ) {
226
226
showSnackbar(R . string. sign_in_cancelled);
227
227
return ;
@@ -232,7 +232,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
232
232
showSnackbar(R . string. no_internet_connection);
233
233
return ;
234
234
}
235
-
235
+
236
236
// User is not signed in. Maybe just wait for the user to press
237
237
// "sign in" again, or show a message.
238
238
}
@@ -300,9 +300,9 @@ if (v.getId() == R.id.sign_out) {
300
300
With the integrations provided by FirebaseUI Auth, deleting a user is a multi-stage process:
301
301
302
302
1 . The user must be deleted from Firebase Auth.
303
- 2 . SmartLock for Passwords must be told to delete any existing Credentials for the user, so
303
+ 2 . Smart Lock for Passwords must be told to delete any existing Credentials for the user, so
304
304
that they are not automatically prompted to sign in with a saved credential in the future.
305
-
305
+
306
306
This process is encapsulated by the ` AuthUI.delete() ` method, which returns a ` Task ` representing
307
307
the entire operation:
308
308
@@ -387,7 +387,7 @@ redefine a string to change it, for example:
387
387
### OAuth Scope Customization
388
388
389
389
#### Google
390
- By default, FirebaseUI requests the ` email ` and ` profile ` scopes when using Google Sign In. If you
390
+ By default, FirebaseUI requests the ` email ` and ` profile ` scopes when using Google Sign- In. If you
391
391
would like to request additional scopes from the user, call ` setPermissions ` on the
392
392
` AuthUI.IdpConfig.Builder ` when initializing FirebaseUI.
393
393
0 commit comments