I'm having trouble getting a custom claim attribute to come through in the id_token. I've got the scope set to OpenId and profile (both in salesforce, AWS Cognito and the URL). I've added the custom attribute to the Connected app (tenantId) and even tried namespacing it (recommendations from auth0.com). Tried using the ConnectedAppPlugin class, and overiding the customAttribute method.

I enabled Configure Id token in the connected app config page and made sure custom claims was ticked (along with standard claims).

All of the above, and I keep getting back an id_token without the additional claim information. Have I missed anything? I know that i can make a call to the userinfo endpoint, but i'm trying to avoid that.

Some one did manage to get it working: Openid Connect - Add custom claim

But left no explanation. Have i missed anything?


I am able to get custom attributes in the Id_Token upon enabling "Include Custom Attributes" as explained in the release notes

Following is what I get when I try the flow using https://openidconnect.herokuapp.com/

 "at_hash": "qzgoS_bMJZeqMG891R61HQ",
 "aud": "3MVG9Y6d_Btp4xp6DzCgTCe.0uVYD_Gk1LZ3Dm8V3DepaqufgLARbdL0snwm8_LrT4mdbN_fBxKYoy0UGOHpj",
 **"custom_attributes": {"ProfileCreatedById": "00590000001VSXz"},**
 "exp": 1553370624,
 "iat": 1553370504,
 "iss": "https://login.salesforce.com",
 "sub": "https://login.salesforce.com/id/00D90000000iulkEAA/00590000001VSXzAAO"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.