This tutorial will show you how to use the Auth0 authentication API in your Android project to create a custom login screen. We recommend you to Log in to follow this quickstart with examples configured for your account.
I want to integrate with my app15 minutes
I want to explore a sample app2 minutes
Get a sample configured with your account settings or check it out on Github.
This tutorial shows you how to use Auth0 to create access roles for your users. With access roles, you can authorize or deny access to your content to different users based on the level of access they have.
Before You Start
Create a rule that assigns the users either an
admin role, or a simple
user role. Go to the new rule page and select the "Set Roles To A User" template, under Access Control. Replace the default script contents with the following snippet:
The default rules for assigning access roles are:
- If the user's email contains
@example.com, the user gets the admin role.
- If the email contains anything else, the user gets the regular user role.
Test the Rule in Your Project
Once the user credentials had been obtained (as explained in the Login tutorial), save them to access them at any time.
The claims added to the ID Token via a Rule are included in the userinfo endpoint response. Use the Access Token to call this endpoint and obtain the user roles.
Restrict Content Based On Access Level
Roles can be used to distinguish user permissions within an app, authorizing or denying access to a certain feature. The sample project illustrates this by allowing users with the
admin role to access the "Settings Activity".