notfoundium
notfoundium•7mo ago

User metadata does not appear in the token

Good day. I am currently using the self-hosted Zitadel, and I have a problem with the metadata in the id_token. I'm relying on the information in the documentation(https://zitadel.com/docs/guides/manage/customize/user-metadata). In order for the metadata to appear in the user's id_token, I need to set in the application settings "User info inside ID token", and I did it in my React app (pic. 1). I have set the specific user's metadata using the API via Python requests, and looks like it was successfully Inserted and then retrieved (pic. 2). But on decrypting the token_id after the next login by this user via my React app, the metadata does not appear in its payload, however, information from other settings is present. (pic. 3).
No description
No description
No description
11 Replies
Unknown User
Unknown User•7mo ago
Message Not Public
Sign In & Join Server To View
notfoundium
notfoundiumOP•7mo ago
Thanks for the reply. I've added it to scope, but nothing seems to have changed ( This is actual request payload:
No description
Rajat Singh
Rajat Singh•7mo ago
hi @notfoundium did the error changed somehow?
notfoundium
notfoundiumOP•7mo ago
Hmm, I cannot say that there is an error. Just the metadata field still did not appear after the changes were made 🤔
Unknown User
Unknown User•7mo ago
Message Not Public
Sign In & Join Server To View
notfoundium
notfoundiumOP•7mo ago
Yes, I did. I also noticed that the set metadata is returned in the response to the API request, but is not displayed in the console:
No description
No description
Unknown User
Unknown User•7mo ago
Message Not Public
Sign In & Join Server To View
notfoundium
notfoundiumOP•7mo ago
In addition to my previous reply, I also checked this user via the console as superuser, and in this case the metadata is displayed:
No description
Unknown User
Unknown User•7mo ago
Message Not Public
Sign In & Join Server To View
notfoundium
notfoundiumOP•7mo ago
Looks like the problem is solved. I had to explicitly enable this setting:
No description

Did you find this page helpful?