Map OIDC/OAuth2 avatar claims to user pictureUrl#7908
Conversation
|
Your the man, dude... |
|
I would prefer a customizable claim field, rather than trying 5 different fields every time. |
|
You are absolutely right, sorry for the overhead. |
|
@mod242 - Awesome, dude... |
|
Thanks! |
|
Hi The login works! but calls https://graph.microsoft.com/v1.0/me/photo/$value (error 401) and the user icon is not visible
I have not been able to identify the origin of the call to prevent get the photo. |
|
I'll try to reproduce. But a short quesition: Your Oauth provider delivers an invalid URL as picture claim, correct? |
The URL is valid, I'm using the Microsoft OAuth2, but the JWT isn't being sent. It returns a 401 Unauthorized error. I'm replacing the provider, and I'm seeing other problems updating the data in the "users" database table:
Some accounts log in perfectly, while others show the error. Finally, I selected the "Generic OpenID Connect / OAuth2" provider. It works without problems; it doesn't claims photo, and there's no database error. The "providerId" field is automatically replaced upon login. |




This change maps common avatar claims from Generic OpenID Connect (and OAuth2) profiles to Wiki.js users. It now reads picture and avatar (including nested profile.* where present) and passes the value as profile.picture, which is the field already used by user processing. As a result, avatar URLs from standard OIDC claims are persisted to users.pictureUrl and shown in the UI after login.
Notes: