Microsoft 365 profile picture as WP avatar
Use this guide if you want to update the WordPress avatar picture with the Microsoft 365 / Azure AD user's equivalent.
Before you start
- You must already have configured the single sign-on capability of the WordPress + Office 365 plugin.
- You must also have configured the integration capability of the plugin.
- You are a Global Administrator for your company’s Office 365 tenant / Azure AD directory (or have at least the ability to edit the Azure Active Directory App registration that was created previously when the single sign-on capability was configured).
- You are an Administrator for your WordPress website.
- To go to the App registration in Azure AD, navigate to WP Admin > WPO365 > Single sign-on and click the link View in Azure Portal for the Application (client) ID.
- A new browser tab opens and loads the App registration in Azure AD.
- Switch to the newly opened tab and to edit the permissions of the App registration.
- Click API permissions from the 'App registration' menu on the left
- Click + Add permission.
- Select Microsoft Graph > Delegated permissions.
- Scroll down to Users and check
Click Add permissions.
- Wait until Grant admin consent for … has become available, then click to grant consent for all users in your tenant to use these permissions when they sign into this app.
- Switch back to the previous tab and the plugin's configuration pages.
- Go WP Admin > WPO365 > User registration and make sure that you added your (custom) domains to the Custom domain(s) list. Click the link to View custom domain names in Azure Portal.
- Continue to WP Admin > WPO365 > User sync.
- Scroll down and check to Use O365 avatar.
- Optionally, if you want the plugin also to update the BuddyPress avatar picture for users also check the option to Use O365 Avatar (Buddy Press).
- Check Save avatar in wp-content for a much better performance (if left unchecked the plugin will save the pictures in the database, which will have a significant effect on the overall performance).
- Optionally - if you know what you're doing - you can choose to update the HTML Avatar template used by the plugin to display the avatar.
- Optionally - if you know what you're doing - you can change the amount of time (in seconds) that the plugin will wait before it will refresh the user's profile picture.