Android Getting started
This multistep quickstart guide will walk you through managing authentication in your android apps with Auth0.
Each tutorial in the series includes a link to its corresponding sample project. You can find all the samples here.
Create a Client
If you haven't already done so, create a new client application in your Auth0 dashboard and choose Native for the Type.
Configure Callback URLs
Callback URLs are the URLs that Auth0 invokes after the authentication process. Auth0 routes your application back to this URL and appends additional parameters to it, including a token. Since callback URLs can be manipulated, you will need to add your application's URL to your client's
Allowed Callback URLs for security. This will enable Auth0 to recognize these URLs as valid. If omitted, authentication will not be successful.
To set a callback URL, navigate to the settings for your client application and include the URL in the "Allowed Callback URLs" text box.
This tutorial series make use of a Callback URL that looks like this:
Remember to replace
YOUR_APP_PACKAGE_NAME with your actual application's package name. Take note of this URL as it's also defined in the
You will require the Client ID and Domain for your client application. These values can be found in your Auth0 dashboard. The suggested approach is to add these credentials to your
strings.xml file so they are accessible to your application.
<string name="auth0_client_id">YOUR_CLIENT_ID</string> <string name="auth0_domain">YOUR_AUTH0_DOMAIN</string>
The values are also used in the Intent-Filter declared in the
<intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:host="@string/auth0_domain" android:pathPrefix="/android/YOUR_APP_PACKAGE_NAME/callback" android:scheme="demo" /> </intent-filter>
YOUR_APP_PACKAGE_NAME with your actual application's package name.