You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/active-directory/develop/userinfo.md
+24-24Lines changed: 24 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,46 +17,46 @@ ms.custom: aaddev
17
17
18
18
# Microsoft identity platform UserInfo endpoint
19
19
20
-
Part of the OpenID Connect (OIDC) standard, the [UserInfo endpoint](https://openid.net/specs/openid-connect-core-1_0.html#UserInfo) is designed to return information (claims) about an authenticated user. In the Microsoft identity platform, the UserInfo endpoint is provided by Microsoft Graph at https://graph.microsoft.com/oidc/userinfo.
20
+
Part of the OpenID Connect (OIDC) standard, the [UserInfo endpoint](https://openid.net/specs/openid-connect-core-1_0.html#UserInfo) is returns information about an authenticated user. In the Microsoft identity platform, the UserInfo endpoint is hosted by Microsoft Graph at https://graph.microsoft.com/oidc/userinfo.
21
21
22
22
## Find the .well-known configuration endpoint
23
23
24
-
You can programmatically discover the UserInfo endpoint using the OpenID Connect discovery document, at `https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration`. It’s listed in the `userinfo_endpoint` field, and this pattern can be used across clouds to help point to the right endpoint. We do not recommend hard-coding the UserInfo endpoint in your app – use the OIDC discovery document to find this endpoint at runtime instead.
24
+
You can find the UserInfo endpoint programmatically by reading the `userinfo_endpoint` field of the OpenID configuration document at `https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration`. We don't recommend hard-coding the UserInfo endpoint in your applications. Instead, use the OIDC configuration document to find the endpoint at runtime.
25
25
26
-
As part of the OpenID Connect specification, the UserInfo endpoint is often automatically called by [OIDCcompliant libraries](https://openid.net/developers/certified/)to get information about the user. Without hosting such an endpoint, the Microsoft identity platform would not be standards compliant and some libraries would fail. From the [list of claims identified in the OIDC standard](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims) we produce the name claims, subject claim, and email when available and consented for.
26
+
The UserInfo endpoint is typically called automatically by [OIDC-compliant libraries](https://openid.net/developers/certified/) to get information about the user.From the [list of claims identified in the OIDC standard](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims), the Microsoft identity platform produces the name claims, subject claim, and email when available and consented to.
27
27
28
-
## Consider: Use an ID Token instead
28
+
## Consider using an ID token instead
29
29
30
-
The information available in the ID token that your app can receive is a superset of the information it can get from the UserInfo endpoint. Because you can get an ID token at the same time you get a token to call the UserInfo endpoint, we suggest that you use that ID token to get information about the user instead of calling the UserInfo endpoint. Using the ID token will eliminate one to two network requests from your application launch, reducing latency in your application.
30
+
The information in an ID token is a superset of the information available on UserInfo endpoint. Because you can get an ID token at the same time you get a token to call the UserInfo endpoint, we suggest getting the user's information from the token instead calling the UserInfo endpoint. Using the ID token instead of calling the UserInfo endopint eliminates up to two network requests, reducing latency in your application.
31
31
32
-
If you require more details about the user, you should call the [Microsoft Graph `/user` API](/graph/api/user-get) to get information like office number or job title. You can also use [optional claims](active-directory-optional-claims.md) to include additional user information in your ID and access tokens.
32
+
If you require more details about the user like manager or job title, call the [Microsoft Graph `/user` API](/graph/api/user-get). You can also use [optional claims](active-directory-optional-claims.md) to include additional user information in your ID and access tokens.
33
33
34
34
## Calling the UserInfo endpoint
35
35
36
-
UserInfo is a standard OAuth Bearer token API, called like any other Microsoft Graph API using the access token received when getting a token for Microsoft Graph. It returns a JSON response containing claims about the user.
36
+
UserInfo is a standard OAuth bearer token API hosted by Microsoft Graph. Call the UserInfo endpoint as you would any Microsoft Graph API by using the access token your application received when it requested access to Microsoft Graph. The UserInfo endpoint returns a JSON response containing claims about the user.
37
37
38
38
### Permissions
39
39
40
-
Use the following [OIDC permissions](v2-permissions-and-consent.md#openid-connect-scopes) to call the UserInfo API. `openid` is required, and the `profile` and `email` scopes ensure that additional information is provided in the response.
40
+
Use the following [OIDC permissions](v2-permissions-and-consent.md#openid-connect-scopes) to call the UserInfo API. The `openid` claim is required, and the `profile` and `email` scopes ensure that additional information is provided in the response.
|Delegated (work or school account) |`openid` (required), `profile`, `email`|
45
+
|Delegated (personal Microsoft account) |`openid` (required), `profile`, `email`|
46
+
|Application | Not applicable|
47
47
48
48
> [!TIP]
49
-
> Copy this URL in your browser to get a token for the UserInfo endpoint as well as an [ID token](id-tokens.md) and replace the client ID and redirect URI with your own. Note that it only requests scopes for OpenID or Graph scopes, and nothing else. This is required, since you cannot request permissions for two different resources in the same token request.
49
+
> Copy this URL in your browser to get an access token for the UserInfo endpoint and an [ID token](id-tokens.md). Replace the client ID and redirect URI with values from an app registration.
> You can use this access token in the next section.
53
+
> You can use the access token that's returned in the query in the next section.
54
54
55
-
As with any other Microsoft Graph token, the token you receive here may not be a JWT. If you signed in a Microsoft account user, it will be an encrypted token format. This is because Microsoft Graph has a special token issuance pattern. This does not impact your ability to use the access token to call the UserInfo endpoint.
55
+
Microsoft Graph uses a special token issuance pattern that may impact your app's ability to read or validate it. As with any other Microsoft Graph token, the token you receive here may not be a JWT and your app should consider it opaque. If you signed in a Microsoft account user, it will be an encrypted token format. None of these factors, however, impact your app's ability to use the access token in a request to the UserInfo endpoint.
56
56
57
57
### Calling the API
58
58
59
-
The UserInfo API supports both GET and POST, per the OIDC spec.
59
+
The UserInfo API supports both GET and POST requests.
The claims listed here are all of the claims that the UserInfo endpoint can return. These are the same values that the app would see in the[ID token](id-tokens.md) issued to the app.
80
+
The claims shown in the response are all those that the UserInfo endpoint can return. These values are the same values included in an[ID token](id-tokens.md).
81
81
82
82
## Notes and caveats on the UserInfo endpoint
83
83
84
-
* If you want to call this UserInfo endpoint you must use the v2.0 endpoint. If you use the v1.0 endpoint you will get a token for the v1.0 UserInfo endpoint, hosted on login.microsoftonline.com. We recommend that all OIDC compliant apps and libraries use the v2.0 endpoint to ensure compatibility.
85
-
* The response from the UserInfo endpoint cannot be customized. If you’d like to customize claims, please use [claims mapping](active-directory-claims-mapping.md) to edit the information returned in the tokens.
86
-
* The response from the UserInfo endpoint cannot be added to. If you’d like to get additional claims about the user, please use [optional claims](active-directory-optional-claims.md) to add new claims to the tokens.
84
+
You can't add to or customize the information returned by the UserInfo endpoint.
85
+
86
+
To customize the information returned by the identity platform during authentication and authorization, use [claims mapping](active-directory-claims-mapping.md) and [optional claims](active-directory-optional-claims.md) to modify security token configuration.
87
87
88
88
## Next Steps
89
89
90
-
*[Review the contents of ID tokens](id-tokens.md)
91
-
*[Customize the contents of an ID token using optional claims](active-directory-optional-claims.md)
92
-
*[Request an access token and ID token using the OAuth2 protocol](v2-protocols-oidc.md)
90
+
*[Review the contents of ID tokens](id-tokens.md).
91
+
*[Customize the contents of an ID token using optional claims](active-directory-optional-claims.md).
92
+
*[Request an access token and ID token using the OAuth 2 protocol](v2-protocols-oidc.md).
0 commit comments