Lock Android v1 Native Social Authentication
Lock by default handles all social authentication with a Browser installed in your Android device, but for some social connections you can take advantage of our native integration.
We implemented native integration with Facebook and Google+ and bundled each of them in a separate Android Library (aar file), to start using them just add these lines in your
Lock uses Facebook Android SDK to obtain the user's credentials and use them to login with your Auth0 application.
To get started, in your
AndroidManifest.xml you need to add the following:
@string/facebook_app_id is your Facebook Application ID that you can get from Facebook Dev Site.
Finally, you need to register Auth0 Facebook Provider with Lock so it can do all Facebook authentication. This can be done in your Application object
onCreate method right after you initialise Lock:
For Google login we use Google Signin library that is part of Google Play Services.
Before we start, you'll need to register your application in Google Developers and create a OAuth 2.0 client, to do that follow this wizard
The next step is to configure your Google connection in Auth0 Dashboard with the newly created OAuth 2.0 client information. Just go to Social Connections, select Google and in the field named
Allowed Mobile Client IDs add the ID of the OAuth 2.0 client.
Then in your
AndroidManifest.xml add these permissions and meta-data value for Google Play Services:
And finally register Google Identity Provider with Lock in your Application object