Custom JWT Claims in Android

Hi,

I am a junior developer. I am having lots of trouble making custom claims in Android-Java. How would I go about accessing user_metadata on the below example with OIDC enabled on New Universal Login?

Thanks!

{
  "email": "jane@example.com",
  "email_verified": true,
  "user_id": "custom|123",
  "favorite_color": "blue",
  "user_metadata": {
    "preferred_contact": "email"
  }
}

auth0 = new Auth0(this);
        auth0.setOIDCConformant(true);

WebAuthProvider.login(auth0)
                .withScheme("demo")
                .withScope("openid offline_access profile http://demo.com/user_metadata.preferred_contact email")
                .withAudience(String.format("https://%s/userinfo", getString(R.string.com_auth0_domain)))

Hi James,

Use a rule. All the details are here: Manage Metadata with Rules

John

Have just discovered that rules are implemented via the Dashboard under rules. Very confusing but we got there.

Cheers!

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