Hello there,
When customizing the claims displayed in your access token using the token configuration in the Azure Active Directory app registration, it's important to note that the changes may not be immediately reflected in the tokens you receive. Here are a few considerations:
Time for changes to take effect: After updating the optional claims in the app registration, it may take some time for the changes to propagate and be applied to the access tokens. In some cases, it could take up to an hour for the changes to be fully effective.
Token caching: Access tokens may be cached by the applications or services that consume them. If a token is cached, it may not include the latest changes made to the optional claims. In such cases, you may need to wait until the token expires or clear the token cache in the consuming application to obtain a fresh token with the updated claims.
Ensure the correct scope: When requesting an access token, ensure that the correct scope is included in the request. The optional claims configuration in the app registration applies to specific scopes. If you're using a different scope that doesn't have the updated optional claims configured, the changes won't be reflected in the token.
Verify token decoding: When decoding the access token, ensure that you are decoding the correct token and that the decoding process is accurate. Use a JWT decoding library or an online JWT decoding tool to verify the token's contents and check if the expected claims are present.
If you have waited for an appropriate amount of time, ensured the correct scope, and confirmed accurate decoding, but still do not observe the updated claims, it might be worth revisiting the optional claims configuration in the app registration to ensure it has been set correctly. Additionally, consider checking the application's code and any token validation or transformation processes to ensure they are handling the claims correctly.
I used AI provided by ChatGPT to formulate part of this response. I have verified that the information is accurate before sharing it with you.
Hope this resolves your Query !!
--If the reply is helpful, please Upvote and Accept it as an answer–