# Populating user avatars with Microsoft Graph Oauth2

**URL:** https://meta.discourse.org/t/populating-user-avatars-with-microsoft-graph-oauth2/191074
**Category:** SSO
**Created:** [May 20, 2021, 1:44pm UTC](https://meta.discourse.org/t/populating-user-avatars-with-microsoft-graph-oauth2/191074 "2021-05-20T13:44:19Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [May 20, 2021, 1:55pm UTC](https://meta.discourse.org/t/populating-user-avatars-with-microsoft-graph-oauth2/191074/2 "2021-05-20T13:55:15Z")

</div>

The OAuth2 plugin only allows requesting the data from a single endpoint (the `oauth2 user json url`). All of the `json ***path` settings refer to** locations within the JSON data**, not separate API endpoints.

Taking a quick look at the [graph.microsoft.com api docs](https://docs.microsoft.com/en-us/graph/api/user-get?view=graph-rest-1.0&tabs=http) it doesn’t look like the `/me` endpoint includes the avatar URL by default. Even **if** you were able to [fetch the profilePhoto resource](https://docs.microsoft.com/en-us/graph/api/resources/profilephoto?view=graph-rest-1.0), it looks like it returns a “photo ID” rather than a URL.

So unfortunately I think you would need to develop a custom authentication plugin to make this work 😢. I’d love to be proven wrong though!

---

_[View the full topic](https://meta.discourse.org/t/populating-user-avatars-with-microsoft-graph-oauth2/191074)._
