Skip to content

Commit 5591561

Browse files
committed
[msid][health] refresh v2-protocols-oidc.md (ADO-2009832)
1 parent df55fbd commit 5591561

File tree

2 files changed

+38
-45
lines changed

2 files changed

+38
-45
lines changed

articles/active-directory/develop/userinfo.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ ms.service: active-directory
99
ms.subservice: develop
1010
ms.workload: identity
1111
ms.topic: conceptual
12-
ms.date: 09/21/2020
12+
ms.date: 08/26/2022
1313
ms.author: ludwignick
1414
ms.reviewer: ludwignick
1515
ms.custom: aaddev
1616
---
1717

1818
# Microsoft identity platform UserInfo endpoint
1919

20-
The UserInfo endpoint is part of the [OpenID Connect standard](https://openid.net/specs/openid-connect-core-1_0.html#UserInfo) (OIDC), designed to return claims about the user that authenticated. For the Microsoft identity platform, the UserInfo endpoint is hosted on Microsoft Graph (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 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.
2121

2222
## Find the .well-known configuration endpoint
2323

articles/active-directory/develop/v2-protocols-oidc.md

Lines changed: 36 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
---
2-
title: Microsoft identity platform and OpenID Connect protocol
3-
description: Build web applications by using the Microsoft identity platform implementation of the OpenID Connect authentication protocol.
4-
services: active-directory
2+
title: OpenID Connect (OIDC) on the Microsoft identity platform
3+
description: Sign in Azure AD users by using the Microsoft identity platform's implementation of the OpenID Connect extension to OAuth 2.0.
54
author: nickludwig
65
manager: CelesteDG
7-
8-
ms.service: active-directory
9-
ms.subservice: develop
10-
ms.workload: identity
11-
ms.topic: conceptual
12-
ms.date: 07/19/2021
136
ms.author: ludwignick
14-
ms.reviewer: ludwignick
157
ms.custom: aaddev, identityplatformtop40
8+
ms.date: 08/26/2022
9+
ms.reviewer: ludwignick
10+
ms.service: active-directory
11+
ms.subservice: develop
12+
ms.topic: reference
1613
---
1714

18-
# Microsoft identity platform and OpenID Connect protocol
15+
# OpenID Connect on the Microsoft identity platform
1916

20-
OpenID Connect (OIDC) is an authentication protocol built on OAuth 2.0 that you can use to securely sign in a user to an application. When you use the Microsoft identity platform's implementation of OpenID Connect, you can add sign-in and API access to your apps. This article shows how to do this independent of language and describes how to send and receive HTTP messages without using any [Microsoft open-source libraries](reference-v2-libraries.md).
17+
OpenID Connect (OIDC) extends the OAuth 2.0 authorization protocol for use also as an authentication protocol. You can use OIDC to enable single sign-on (SSO) between your OAuth-enabled applications.
2118

22-
[OpenID Connect](https://openid.net/specs/openid-connect-core-1_0.html) extends the OAuth 2.0 *authorization* protocol for use as an *authentication* protocol, so that you can do single sign-on using OAuth. OpenID Connect introduces the concept of an *ID token*, which is a security token that allows the client to verify the identity of the user. The ID token also gets basic profile information about the user. It also introduces the [UserInfo endpoint](userinfo.md), an API that returns information about the user.
19+
OpenID Connect introduces a type of security token called an *ID token* that allows the client application to verify the identity of a user. The ID token includes information (claims) about an authenticated user, and the user's information is also made available at the OIDC [UserInfo endpoint](userinfo.md).
2320

24-
[!INCLUDE [try-in-postman-link](includes/try-in-postman-link.md)]
21+
The full OIDC specification is available on the OpenID Foundation's website at [OpenID Connect Core 1.0 specification](https://openid.net/specs/openid-connect-core-1_0.html).
2522

26-
## Protocol diagram: Sign-in
23+
## Protocol flow: Sign-in
2724

28-
The most basic sign-in flow has the steps shown in the next diagram. Each step is described in detail in this article.
25+
This diagram shows the basic OpenID Connect sign-in flow. The steps in the flow are described in detail in the sections that follow.
2926

30-
![OpenID Connect protocol: Sign-in](./media/v2-protocols-oidc/convergence-scenarios-webapp.svg)
27+
[!INCLUDE [try-in-postman-link](includes/try-in-postman-link.md)]
28+
29+
![Swim-lane diagram showing the OpenID Connect protocol's sign-in flow.](./media/v2-protocols-oidc/convergence-scenarios-webapp.svg)
3130

32-
## Fetch the OpenID Connect metadata document
31+
## Requesting the OpenID Connect discovery document
3332

34-
OpenID Connect describes a metadata document [(RFC)](https://openid.net/specs/openid-connect-discovery-1_0.html) that contains most of the information required for an app to do sign in. This includes information such as the URLs to use and the location of the service's public signing keys. You can find this document by appending the discovery document path to the authority URL:
33+
OpenID Connect also provides and endpoint for the [discovery of OIDC metadata](https://openid.net/specs/openid-connect-discovery-1_0.html) for a service. Client applications can use the information in metadata document to find URLs to use for authentication and the authentication service's public signing keys. Most often, an authentication library you use in your app uses the OpenID Connect discovery document without requiring your hand-coding these details into your application.
3534

36-
Discovery document path: `/.well-known/openid-configuration`
35+
Every app registration in Azure AD includes publicly accessible OIDC discovery documents. To determine the URL your app can use to get most of the information it needs to sign in users, append the _discovery document path_ to your app registration's _authority URL_.
3736

38-
Authority: `https://login.microsoftonline.com/{tenant}/v2.0`
37+
* Discovery document path: `/.well-known/openid-configuration`
38+
* Authority URL: `https://login.microsoftonline.com/{tenant}/v2.0`
3939

40-
The `{tenant}` can take one of four values:
40+
The value of `{tenant}` varies based on the application's sign-in audience as shown in the following table. The authority URL also varies by [cloud instance](authentication-national-cloud.md#azure-ad-authentication-endpoints).
4141

4242
| Value | Description |
4343
| --- | --- |
@@ -46,14 +46,12 @@ The `{tenant}` can take one of four values:
4646
| `consumers` |Only users with a personal Microsoft account can sign in to the application. |
4747
| `8eaef023-2b34-4da1-9baa-8bc8c9d6a490` or `contoso.onmicrosoft.com` | Only users from a specific Azure AD tenant (whether they are members in the directory with a work or school account, or they are guests in the directory with a personal Microsoft account) can sign in to the application. Either the friendly domain name of the Azure AD tenant or the tenant's GUID identifier can be used. You can also use the consumer tenant, `9188040d-6c67-4c5b-b112-36a304b66dad`, in place of the `consumers` tenant. |
4848

49-
The authority differs across national clouds - e.g. `https://login.microsoftonline.de` for the Azure AD Germany instance. If you do not use the public cloud, please review the [national cloud endpoints](authentication-national-cloud.md#azure-ad-authentication-endpoints) to find the appropriate one for you. Ensure that the tenant and `/v2.0/` are present in your request so you can use the v2.0 version of the endpoint.
50-
5149
> [!TIP]
52-
> Try it! Click [https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration](https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration) to see the `common` configuration.
50+
> Try it! Select [https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration](https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration) to see the OIDC discovery document for the `common` configuration.
5351
5452
### Sample request
5553

56-
To call the userinfo endpoint for the common authority on the public cloud, use the following:
54+
To call the UserInfo endpoint for the `common` authority on the Azure public cloud:
5755

5856
```http
5957
GET /common/v2.0/.well-known/openid-configuration
@@ -62,7 +60,7 @@ Host: login.microsoftonline.com
6260

6361
### Sample response
6462

65-
The metadata is a simple JavaScript Object Notation (JSON) document. See the following snippet for an example. The contents are fully described in the [OpenID Connect specification](https://openid.net/specs/openid-connect-discovery-1_0.html#rfc.section.4.2).
63+
The metadata is returned in JSON format as shown in following example (truncated for brevity). The contents of the JSON response are described fully in the [OpenID Connect 1.0 discovery specification](https://openid.net/specs/openid-connect-discovery-1_0.html#rfc.section.4.2).
6664

6765
```json
6866
{
@@ -78,30 +76,25 @@ The metadata is a simple JavaScript Object Notation (JSON) document. See the fol
7876
"pairwise"
7977
],
8078
...
81-
8279
}
8380
```
8481

85-
If your app has custom signing keys as a result of using the [claims-mapping](active-directory-claims-mapping.md) feature, you must append an `appid` query parameter containing the app ID in order to get a `jwks_uri` pointing to your app's signing key information. For example: `https://login.microsoftonline.com/{tenant}/v2.0/.well-known/openid-configuration?appid=6731de76-14a6-49ae-97bc-6eba6914391e` contains a `jwks_uri` of `https://login.microsoftonline.com/{tenant}/discovery/v2.0/keys?appid=6731de76-14a6-49ae-97bc-6eba6914391e`.
86-
87-
Typically, you would use this metadata document to configure an OpenID Connect library or SDK; the library would use the metadata to do its work. However, if you're not using a pre-built OpenID Connect library, you can follow the steps in the remainder of this article to do sign-in in a web app by using the Microsoft identity platform.
82+
<!-- UNCOMMENT WHEN/IF THE EXAMPLE APP REGISTRATION IS RE-ENABLED -->
83+
<!-- If your app has custom signing keys as a result of using [claims mapping](active-directory-claims-mapping.md), append the `appid` query parameter to include the `jwks_uri` claim that includes your app's signing key information. For example, `https://login.microsoftonline.com/{tenant}/v2.0/.well-known/openid-configuration?appid=6731de76-14a6-49ae-97bc-6eba6914391e` includes a `jwks_uri` of `https://login.microsoftonline.com/{tenant}/discovery/v2.0/keys?appid=6731de76-14a6-49ae-97bc-6eba6914391e`. -->
8884

8985
## Send the sign-in request
9086

91-
When your web app needs to authenticate the user, it can direct the user to the `/authorize` endpoint. This request is similar to the first leg of the [OAuth 2.0 authorization code flow](v2-oauth2-auth-code-flow.md), with these important distinctions:
87+
To authenticate the user in your web application, direct the their user-agent to the `/authorize` endpoint. The request is similar to the first leg of the [OAuth 2.0 authorization code flow](v2-oauth2-auth-code-flow.md), with these important distinctions:
9288

9389
* The request must include the `openid` scope in the `scope` parameter.
9490
* The `response_type` parameter must include `id_token`.
9591
* The request must include the `nonce` parameter.
92+
* Select the **ID tokens (used for implicit and hybrid flows)** checkbox under **Implicit grant and hybrid flows** in **Azure Active Directory** > **App registrations** > \<your application\> **Authentication** in the Azure portal.
93+
* Checking the ID tokens checkbox sets `oauth2AllowIdTokenImplicitFlow` to `true` in the [application manifest](reference-app-manifest.md). If you fail to select the ID tokens checkbox, an `unsupported_response` error is returned similar to: "The provided value for the input parameter 'response_type' isn't allowed for this client. Expected value is 'code'".
9694

97-
> [!IMPORTANT]
98-
> In order to successfully request an ID token from the /authorization endpoint, the app registration in the [registration portal](https://portal.azure.com) must have the implicit grant of id_tokens enabled in the Authentication tab (which sets the `oauth2AllowIdTokenImplicitFlow` flag in the [application manifest](reference-app-manifest.md) to `true`). If it isn't enabled, an `unsupported_response` error will be returned: "The provided value for the input parameter 'response_type' isn't allowed for this client. Expected value is 'code'"
99-
100-
For example:
95+
Example request (line breaks are included for readability only):
10196

10297
```HTTP
103-
// Line breaks are for legibility only.
104-
10598
GET https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize?
10699
client_id=6731de76-14a6-49ae-97bc-6eba6914391e
107100
&response_type=id_token
@@ -132,7 +125,7 @@ After the user authenticates and grants consent, the Microsoft identity platform
132125

133126
### Successful response
134127

135-
A successful response when you use `response_mode=form_post` looks like this:
128+
A successful response when you use `response_mode=form_post`:
136129

137130
```HTTP
138131
POST /myapp/ HTTP/1.1
@@ -149,7 +142,7 @@ id_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik1uQ19WWmNB...&state=12345
149142

150143
### Error response
151144

152-
Error responses might also be sent to the redirect URI so that the app can handle them. An error response looks like this:
145+
Error responses might also be sent to the redirect URI so the app can handle them:
153146

154147
```HTTP
155148
POST /myapp/ HTTP/1.1
@@ -180,7 +173,7 @@ The following table describes error codes that can be returned in the `error` pa
180173

181174
## Validate the ID token
182175

183-
Just receiving an id_token isn't always sufficient to authenticate the user; you may also need to validate the id_token's signature and verify the claims in the token per your app's requirements. Like all OIDC platforms, the Microsoft identity platform uses [JSON Web Tokens (JWTs)](https://tools.ietf.org/html/rfc7519) and public key cryptography to sign ID tokens and verify that they're valid.
176+
Merely receiving an ID token isn't always sufficient to authenticate the user; you may also need to validate the ID token's signature and verify its claims per your app's requirements. Like all OIDC platforms, the Microsoft identity platform uses [JSON Web Tokens (JWTs)](https://tools.ietf.org/html/rfc7519) and public key cryptography to sign ID tokens and verify they're valid.
184177

185178
Not all apps benefit from verifying the ID token - native apps and single page apps, for instance, rarely benefit from validating the ID token. Someone with physical access to the device (or browser) can bypass the validation in many ways - from editing the web traffic to the device to provide fake tokens and keys to simply debugging the application to skip the validation logic. On the other hand, web apps and APIs using an ID token to authorization must validate the ID token carefully since they are gating access to data.
186179

@@ -227,7 +220,7 @@ You can also use the [authorization code flow](v2-oauth2-auth-code-flow.md), the
227220
228221
### Successful token response
229222

230-
A successful response from using `response_mode=form_post` looks like this:
223+
A successful response from using `response_mode=form_post`:
231224

232225
```HTTP
233226
POST /myapp/ HTTP/1.1
@@ -256,7 +249,7 @@ Response parameters mean the same thing regardless of the flow used to acquire t
256249

257250
### Error response
258251

259-
Error responses might also be sent to the redirect URI so that the app can handle them appropriately. An error response looks like this:
252+
Error responses might also be sent to the redirect URI so that the app can handle them appropriately:
260253

261254
```HTTP
262255
POST /myapp/ HTTP/1.1

0 commit comments

Comments
 (0)