Skip to content

Sync the avatar from Entra ID on login - #72

Open
stevetemple wants to merge 10 commits into
mainfrom
feature/set-avatar
Open

Sync the avatar from Entra ID on login#72
stevetemple wants to merge 10 commits into
mainfrom
feature/set-avatar

Conversation

@stevetemple

@stevetemple stevetemple commented Jul 28, 2026

Copy link
Copy Markdown
Member

Describe your changes

Fetch Azure profile image to use as avatar in Umbraco

Link to issue

#11

Checklist before requesting a review

  • I have performed a self-review of my code

Copilot AI review requested due to automatic review settings July 28, 2026 13:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an opt-in feature to sync a user’s Microsoft Entra ID (Azure AD) profile photo into Umbraco as the backoffice avatar during login, via Microsoft Graph.

Changes:

  • Introduces SetProfileImageOnLogin configuration flag (default false) across configuration/settings/schema.
  • Requests User.Read scope (and saves tokens) when enabled, then fetches /me/photo/$value and writes it to the Umbraco media file system as the user avatar.
  • Documents the new setting across versioned READMEs.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/Umbraco.Community.AzureSSO/Settings/AzureSSOSettings.cs Exposes SetProfileImageOnLogin in profile settings.
src/Umbraco.Community.AzureSSO/MicrosoftAccountBackOfficeExternalLoginProviderOptions.cs Implements profile photo fetch + avatar persistence on external login.
src/Umbraco.Community.AzureSSO/MicrosoftAccountAuthenticationExtensions.cs Adds conditional Graph scope and enables SaveTokens when profile photo sync is enabled.
src/Umbraco.Community.AzureSSO/AzureSSOConfiguration.cs Adds configuration property and includes it in “all values empty” detection.
src/Umbraco.Community.AzureSSO/appsettings-schema.UmbracoCommunityAzureSSO.json Documents the new SetProfileImageOnLogin setting in the schema.
src/.editorconfig Updates comment/formatting in editorconfig (line ending comment + whitespace).
README-v15plus.md Documents Profile Photo feature and setting behavior.
README-v14plus.md Documents Profile Photo feature and setting behavior.
README-v13.md Documents Profile Photo feature and setting behavior.
README-uptov12.md Documents Profile Photo feature and setting behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README-v15plus.md Outdated
Comment thread README-v14plus.md Outdated
Comment thread README-v13.md Outdated
Comment thread README-uptov12.md Outdated
@stevetemple
stevetemple marked this pull request as draft July 28, 2026 13:07
- Register IHttpClientFactory only when SetProfileImageOnLogin is enabled, since the package otherwise assumes the host app has registered it
- Derive the saved avatar's file extension from the Graph response Content-Type instead of assuming jpg, and hash the filename with SHA256 instead of SHA1
- Treat a 404 from the photo endpoint as "no photo set" (silent) and log a warning for other failure statuses, matching the README wording
@stevetemple
stevetemple marked this pull request as ready for review July 30, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants