Skip to content

Fetch OIDC profile pictures server-side when URL requires authentication - #510

Merged
tale merged 1 commit into
tale:mainfrom
lloydowen:fix/oidc-profile-pictures
Mar 24, 2026
Merged

tale merged 1 commit into
tale:mainfrom
lloydowen:fix/oidc-profile-pictures

Conversation

@lloydowen

Copy link
Copy Markdown
Contributor

Some OIDC providers (e.g. Microsoft Entra ID) return a profile picture URL that requires a Bearer token to access. The browser cannot attach auth headers to <img> tags, resulting in a 401.

This change fetches the picture server-side during the OIDC callback using the access token already available from the auth code grant. If the response is an image, it's converted to a base64 data URI and stored in the session. If the fetch fails or the content isn't an image, it falls back to the original URL.

Fixes #326

@lloydowen
lloydowen requested a review from tale as a code owner March 24, 2026 11:49
@github-actions github-actions Bot added the Authentication Authentication & Permissions label Mar 24, 2026
@tale
tale merged commit 873e600 into tale:main Mar 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Authentication Authentication & Permissions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Profile pictures missed when using Microsoft Entra ID OpenID

2 participants