Create and Authorize a Machine-to-Machine Application

Lock Android v1 Native Social Authentication


This document covers an outdated version of scopesLock for Android. We recommend you to upgrade to v2.

This feature relies on a deprecated grant type. Applications created after June 8th 2017 won't be able to use this feature. We recommend using browser-based flows, as explained in Authentication via Universal Login.

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 build.gradle:

Example: Get All Clients Endpoint


Keep reading


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:

Where @string/facebook_app_id is your Facebook Application ID that you can get from Facebook Dev Site.

For more information please check Facebook Getting Started Guide.

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 onCreate: