Add optional OIDC avatar fetching from the picture claim#5429
Add optional OIDC avatar fetching from the picture claim#5429ssddanbrown merged 1 commit intoBookStackApp:developmentfrom
picture claim#5429Conversation
picture claim
|
Thanks for providing this @rubentalstra. Is the authorization header in the picture URL request based upon any actual need or standard/specification? Also, I wouldn't look to have this run on each login, just the first registration/sync as per all existing details in support SSO options. We'll also need to add testing to cover the added functionality. I'm happy to make these changes/additions before merge, but I really just need to know about the authorization point above. |
|
@ssddanbrown hi, thank you for taking the time. The header is for sure needed if you use Microsoft because it will call a global endpoint. And based on the header it will return the users profile. |
|
Thanks for this @rubentalstra. I can confirm via testing. I'm siding towards not sending any auth tokens, leaving any non-spec services like Entra/AzureAD use our logical theme hooks to work around their awkardness. Another consideration for this PR: it's currently saving images as png, which probably will be the most common, but this is not assured; The spec does not confirm exact formats. |
Review of #5429, OIDC avatar fetching
|
This has now been merged for the next release, thanks again @rubentalstra. |
@ssddanbrown thank you for reviewing my PR. I'm happy to see that it was not for nothing 😉 |
This update enables BookStack to optionally fetch user avatars from the OIDC
pictureclaim. The implementation:pictureclaim for use as user avatar #4271fetch_avatarsconfig flag inconfig/oidc.phpto toggle avatar retrieval.UserAvatars->assignToUserFromUrl($user, $picture, $accessToken)to support both public and private (Bearer token-protected) endpoints.pictureclaim from the user’s ID token or userinfo response, if provided.pictureURL.picturefield.This approach does not break existing behavior; avatar fetching is off by default. If enabled, BookStack will try to update a user’s avatar upon login, using the token to authenticate if necessary.