- Add idemeum SDK dependency to gradle
In your app's build.gradle dependencies section, add the following:
implementation 'com.idemeum:identity-android-sdk:1.0.0'
- Create URL scheme
Add URL scheme code in Android Manifest XML file.
<activity android:name="com.idemeum.androidsdk.ui.RedirectUriReceiverActivity"
android:exported="true">
<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="auth"
android:scheme="idemeum" />
</intent-filter>
</activity>
Initialize idemeum SDK instance. Use your clientId that you obtained from idemeum developer portal.
IdemeumManager mIdemeumManager = IdemeumManager.getInstance("<-- ClientId -->");
mIdemeumManager.isLoggedIn(this, isLoggedIn - > {
// Process the user logged-in state.
if (isLoggedIn) {
// user is logged in
} else {
// user is NOT logged in
}
});
mIdemeumManager.login(this, new IdemeumSigninListener() {
@Override
public void onSuccess(OIDCToken oidcToken) {
/* receive ID and Access tokens from idemeum
{
"accessToken": "string",
"expires_in": 0,
"idToken": "string"
} */
}
@Override
public void onError(int statusCode, String error) {
// Login fail
}
});
mIdemeumManager.userClaims(this, new TokenValidationListener() {
@Override
public void onSuccess(JSONObject claims) {
//fetch user approved claims from JSON response
}
@Override
public void onError(int errorCode, String errorMsg) {
// If there is an error you can process it here
}
});
mIdemeumManager.logout()
You can checkout the complete documentation guide here
You can reach us at [email protected]
This project uses the following license: MIT License