How to get idTokenPayload from Android auth SDK

Hi there,

How can I get idTokenPayload from Android auth SDK? We use auth0.WebAuth as well and it’s working but WebAuthProvider doesn’t.

Thanks

1 Like

I’m not familiar with the Android SDK so someone else might provide a better answer, but it seems that the SDK gives you the raw ID token string, and you’ll have to decode it yourself:

import com.auth0.android.jwt.JWT;
[...]
        final JWT decodedIdToken;
        try {
            decodedIdToken = new JWT(idToken);
        } catch (DecodeException ignored) {
            // handle decoding error
        }

The ID Token will be a property of the Credentials instance that is available in the onSuccess method of the authentication callback.

Thanks @nicolas_sabena you’re right and I saw what I need via jwt.io

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.