]> BookStack Code Mirror - hacks/blob - content/oidc-azure-avatar-images/index.md
Added OIDC Azure avatar image hack
[hacks] / content / oidc-azure-avatar-images / index.md
1 +++
2 title = "Azure/Entra OIDC User Avatar Images on Initial Login"
3 author = "@ssddanbrown"
4 date = 2025-11-01T15:00:00Z
5 updated = 2025-11-01T15:00:00Z
6 tested = "v25.07.3"
7 +++
8
9 This hack hooks into the OIDC login process to fetch and assign user avatar images from Azure/Entra on first user login/registration.
10
11 OIDC user avatar images have been [officially supported in BookStack since v25.05](https://www.bookstackapp.com/blog/bookstack-release-v25-05/#oidc-user-avatar-support),
12 but this does not work for Microsoft Azure since it requires a process which does not strictly meet the OIDC specification.
13
14 #### Considerations
15
16 - This will only run when the user account is initially created via first login.
17   - It will not run if the user account already exists, or if it's created by an admin user.
18 - This is designed to work with either PNG or JPEG user avatar images.
19
20 #### Code
21
22 {{<hack file="functions.php" type="logical">}}