Go passwordless with Android SDK¶
This integration guide will help you quickly implement passwordless login for your Android mobile application.
Resources to help
Here are all the resources that will help you navigate how idemeum Android SDK works, what user experience it empowers, and how you can drop it in quickly into your Android app.
Similar to our other SDKs, idemeum Android SDK provides 4 methods to help you with your login needs:
isLoggedIn. By leveraging these methods you can enable passwordless, secure, and private login for your application.
What we will do¶
In this guide we will go through the following steps to implement idemeum Android SDK:
- Initialize idemeum SDK
- Manage authentication state with
- Log the user in and out with
- Get and validate user claims with
1. Initialize idemeum SDK¶
Add idemeum SDK dependency to gradle¶
In your app's
build.gradle dependencies section, add the following:
Create URL scheme¶
Add URL scheme code in
Android Manifest XML file.
1 2 3 4 5 6 7 8 9
Initialize idemeum SDK¶
We can now initialize the
IdemeumManager instance of idemeum SDK. Do not forget to use your
clientId that you obtained from idemeum developer portal.
2. Manage user authentication state¶
idemeum SDK helps you manage the authentication state of the user, so that you can determine if the user is logged in or not and then take actions depending on the outcome. With idemeum
isLoggedIn we can obtain Boolean value for idemeum authentication state.
- If the user is logged in, we will greet the user and display user claims.
- In case the user is not logged in, we will not show any content and will simply display the login button.
1 2 3 4 5 6 7 8 9 10 11
3. Log the user in and out with
When the user clicks the Login button, idemeum SDK will trigger the
login method. Let's define what will need to happen in our application. On success our application will receive ID and Access tokens from idemeum. We will need to process and validate those tokens. In case there is failure, we can process that as well in our code.
1 2 3 4 5 6 7 8 9 10 11 12 13
When the user clicks the Logout button, idemeum SDK will trigger the logout method.
4. Validate and get user claims with
idemeum SDK returns ID and Access tokens upon successful user login. For token validation you can:
- Validate token yourself using any of the open source JWT token validation libraries
- Use idemeum SDK that provides userClaims method to validate tokens and extract user claims
In our guide we will rely on idemeum SDKs to validate tokens and extract user identity claims.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
Congratulations ! You completed integration with idemeum Android SDK.
Let us know if you need any help or have questions.