gordieb
gordieb

Reputation: 251

Unable to get ID token (Azure AD) using MSAL 1.0 for Android

In our Android app that uses MSAL 1.0 we can successfully sign-in to Azure AD. However, we cannot find a way to get ID token. Some examples on line show two ways to get ID token: IAuthenticationResult.getIdToken() and IAccount.getClaims().get("id_token"). Neither of the methods works for us. The former does not exist as a method in IAuthenticationResult. The latter always returns null.

I've looked at the source code that does the signing in and noticed that ID tokens are acquired and parsed into claims. However, it does not look like they are made available to library users in their raw formats.

I've verified during debugging that valid ID tokens are being acquired.

Our app needs to pass ID tokens to our back-end server.

Is there another way to access ID tokens using MSAL?

Btw, we do not have this problem on iOS and MSAL.

Upvotes: 3

Views: 2352

Answers (1)

Apostolos Apostolidis
Apostolos Apostolidis

Reputation: 189

I have confirmed that the feature is not present in the Android version (although the id token is accessible as a string in the iOS version). It will be implemented in the future. For reference look here:

https://github.com/AzureAD/microsoft-authentication-library-for-android/issues/850

Upvotes: 1

Related Questions