Skip to content

Commit 562b2e5

Browse files
committed
Merge branch 'main' into release-ga-azure-firewall-basic
2 parents 805566d + 9cac497 commit 562b2e5

File tree

467 files changed

+3118
-1237
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

467 files changed

+3118
-1237
lines changed

.openpublishing.redirection.defender-for-cloud.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@
787787
},
788788
{
789789
"source_path_from_root": "/articles/defender-for-cloud/os-coverage.md",
790-
"redirect_url": "/azure/defender-for-cloud/monitoring-components",
790+
"redirect_url": "/azure/defender-for-cloud/support-matrix-defender-for-cloud#supported-operating-systems",
791791
"redirect_document_id": false
792792
},
793793
{

articles/active-directory-b2c/access-tokens.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Request an access token - Azure Active Directory B2C
2+
title: Request an access token in Azure Active Directory B2C
33
description: Learn how to request an access token from Azure Active Directory B2C.
44
services: active-directory-b2c
55
author: kengaderdus
@@ -8,20 +8,20 @@ manager: CelesteDG
88
ms.service: active-directory
99
ms.workload: identity
1010
ms.topic: conceptual
11-
ms.date: 02/07/2022
11+
ms.date: 03/09/2023
1212
ms.custom: project-no-code
1313
ms.author: kengaderdus
1414
ms.subservice: B2C
1515

1616
---
1717
# Request an access token in Azure Active Directory B2C
1818

19-
An *access token* contains claims that you can use in Azure Active Directory B2C (Azure AD B2C) to identify the granted permissions to your APIs. When calling a resource server, an access token must be present in the HTTP request. An access token is denoted as **access_token** in the responses from Azure AD B2C.
19+
An *access token* contains claims that you can use in Azure Active Directory B2C (Azure AD B2C) to identify the granted permissions to your APIs. To call a resource server, the HTTP request must include an access token. An access token is denoted as **access_token** in the responses from Azure AD B2C.
2020

2121
This article shows you how to request an access token for a web application and web API. For more information about tokens in Azure AD B2C, see the [overview of tokens in Azure Active Directory B2C](tokens-overview.md).
2222

2323
> [!NOTE]
24-
> **Web API chains (On-Behalf-Of) is not supported by Azure AD B2C.** - Many architectures include a web API that needs to call another downstream web API, both secured by Azure AD B2C. This scenario is common in clients that have a web API back end, which in turn calls a another service. This chained web API scenario can be supported by using the OAuth 2.0 JWT Bearer Credential grant, otherwise known as the On-Behalf-Of flow. However, the On-Behalf-Of flow is not currently implemented in Azure AD B2C. Although On-Behalf-Of works for applications registered in Azure AD, it does not work for applications registered in Azure AD B2C, regardless of the tenant (Azure AD or Azure AD B2C) that is issuing the tokens.
24+
> **Web API chains (On-Behalf-Of) is not supported by Azure AD B2C** - Many architectures include a web API that needs to call another downstream web API, both secured by Azure AD B2C. This scenario is common in clients that have a web API back end, which in turn calls a another service. This chained web API scenario can be supported by using the OAuth 2.0 JWT Bearer Credential grant, otherwise known as the On-Behalf-Of flow. However, the On-Behalf-Of flow is not currently implemented in Azure AD B2C. Although On-Behalf-Of works for applications registered in Azure AD, it does not work for applications registered in Azure AD B2C, regardless of the tenant (Azure AD or Azure AD B2C) that is issuing the tokens.
2525
2626
## Prerequisites
2727

@@ -60,17 +60,7 @@ If the **response_type** parameter in an `/authorize` request includes `token`,
6060

6161
## Request a token
6262

63-
To request an access token, you need an authorization code. Below is an example of a request to the `/authorize` endpoint for an authorization code.
64-
65-
In the following example, you replace these values in the query string:
66-
67-
- `<tenant-name>` - The name of your [Azure AD B2C tenant](tenant-management-read-tenant-name.md#get-your-tenant-name). If you're using a custom domain, replace `tenant-name.b2clogin.com` with your domain, such as `contoso.com`.
68-
- `<policy-name>` - The name of your custom policy or user flow.
69-
- `<application-ID>` - The application identifier of the web application that you registered to support the user flow.
70-
- `<application-ID-URI>` - The application identifier URI that you set under **Expose an API** blade of the client application.
71-
- `<scope-name>` - The name of the scope that you added under **Expose an API** blade of the client application.
72-
- `<redirect-uri>` - The **Redirect URI** that you entered when you registered the client application.
73-
63+
To request an access token, you need an authorization code. The following is an example of a request to the `/authorize` endpoint for an authorization code:
7464
```http
7565
GET https://<tenant-name>.b2clogin.com/<tenant-name>.onmicrosoft.com/<policy-name>/oauth2/v2.0/authorize?
7666
client_id=<application-ID>
@@ -80,17 +70,26 @@ client_id=<application-ID>
8070
&response_type=code
8171
```
8272

73+
Replace the values in the query string as follows:
74+
75+
- `<tenant-name>` - The name of your [Azure AD B2C tenant](tenant-management-read-tenant-name.md#get-your-tenant-name). If you're using a custom domain, replace `tenant-name.b2clogin.com` with your domain, such as `contoso.com`.
76+
- `<policy-name>` - The name of your custom policy or user flow.
77+
- `<application-ID>` - The application identifier of the web application that you registered to support the user flow.
78+
- `<application-ID-URI>` - The application identifier URI that you set under **Expose an API** blade of the client application.
79+
- `<scope-name>` - The name of the scope that you added under **Expose an API** blade of the client application.
80+
- `<redirect-uri>` - The **Redirect URI** that you entered when you registered the client application.
81+
8382
To get a feel of how the request works, paste the request into your browser and run it.
8483

85-
This is the interactive part of the flow, where you take action. You're asked to complete the user flow's workflow. This might involve entering your username and password in a sign in form or any other number of steps. The steps you complete depend on how the user flow is defined.
84+
This's the interactive part of the flow, where you take action. You're asked to complete the user flow's workflow. This might involve entering your username and password in a sign in form or any other number of steps. The steps you complete depend on how the user flow is defined.
8685

8786
The response with the authorization code should be similar to this example:
8887

8988
```
9089
https://jwt.ms/?code=eyJraWQiOiJjcGltY29yZV8wOTI1MjAxNSIsInZlciI6IjEuMC...
9190
```
9291

93-
After successfully receiving the authorization code, you can use it to request an access token. Note that the parameters are in the body of the HTTP POST request:
92+
After successfully receiving the authorization code, you can use it to request an access token. The parameters are in the body of the HTTP POST request:
9493

9594
```http
9695
POST <tenant-name>.b2clogin.com/<tenant-name>.onmicrosoft.com/<policy-name>/oauth2/v2.0/token HTTP/1.1
@@ -105,7 +104,7 @@ grant_type=authorization_code
105104
&client_secret=2hMG2-_:y12n10vwH...
106105
```
107106

108-
If you're testing this POST HTTP request, you can use any HTTP client such as [Microsoft PowerShell](/powershell/scripting/overview) or [Postman](https://www.postman.com/).
107+
If you want to test this POST HTTP request, you can use any HTTP client such as [Microsoft PowerShell](/powershell/scripting/overview) or [Postman](https://www.postman.com/).
109108

110109
A successful token response looks like this:
111110

articles/active-directory-b2c/configure-authentication-sample-angular-spa-app.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ manager: CelesteDG
77
ms.service: active-directory
88
ms.workload: identity
99
ms.topic: how-to
10-
ms.date: 03/30/2022
10+
ms.date: 03/09/2023
1111
ms.author: kengaderdus
1212
ms.subservice: B2C
1313
ms.custom: "b2c-support"
@@ -35,7 +35,7 @@ The sign-in flow involves the following steps:
3535

3636
### App registration
3737

38-
To enable your app to sign in with Azure AD B2C and call a web API, you must register two applications in the Azure AD B2C directory:
38+
To enable your app to sign in with Azure AD B2C and call a web API, you must register two applications in your Azure AD B2C tenant:
3939

4040
- The *single-page application* (Angular) registration enables your app to sign in with Azure AD B2C. During app registration, you specify the *redirect URI*. The redirect URI is the endpoint to which the user is redirected after they authenticate with Azure AD B2C. The app registration process generates an *application ID*, also known as the *client ID*, that uniquely identifies your app. This article uses the example **App ID: 1**.
4141

@@ -57,7 +57,7 @@ The following diagram describes the app registrations and the app architecture.
5757

5858
Before you follow the procedures in this article, make sure that your computer is running:
5959

60-
* [Visual Studio Code](https://code.visualstudio.com/) or another code editor.
60+
* [Visual Studio Code](https://code.visualstudio.com/) or any other code editor.
6161
* [Node.js runtime](https://nodejs.org/en/download/) and [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
6262
* [Angular CLI](https://angular.io/cli).
6363

@@ -82,8 +82,9 @@ In this step, you create the registrations for the Angular SPA and the web API a
8282
Follow these steps to create the Angular app registration:
8383

8484
1. Sign in to the [Azure portal](https://portal.azure.com).
85-
1. Make sure you're using the directory that contains your Azure AD B2C tenant. Select the **Directories + subscriptions** icon in the portal toolbar.
86-
1. On the **Portal settings | Directories + subscriptions** page, find your Azure AD B2C directory in the **Directory name** list, and then select **Switch**.
85+
1. Make sure you're using the directory that contains your Azure AD B2C tenant:
86+
1. Select the **Directories + subscriptions** icon in the portal toolbar.
87+
2. On the **Portal settings | Directories + subscriptions** page, find your Azure AD B2C directory in the **Directory name** list, and then select **Switch**.
8788
1. In the Azure portal, search for and select **Azure AD B2C**.
8889
1. Select **App registrations**, and then select **New registration**.
8990
1. For **Name**, enter a name for the application. For example, enter **MyApp**.
@@ -203,7 +204,7 @@ Your final configuration file should look like the following JSON:
203204

204205
## Step 5: Run the Angular SPA and web API
205206

206-
You're now ready to test the Angular scoped access to the API. In this step, run both the web API and the sample Angular application on your local machine. Then, log in to the Angular application, and select the **TodoList** button to start a request to the protected API.
207+
You're now ready to test the Angular scoped access to the API. In this step, run both the web API and the sample Angular application on your local machine. Then, sign in to the Angular application, and select the **TodoList** button to start a request to the protected API.
207208

208209
### Run the web API
209210

@@ -252,8 +253,8 @@ You're now ready to test the Angular scoped access to the API. In this step, run
252253

253254
![Screenshot that shows the Angular sample app with the login link.](./media/configure-authentication-sample-angular-spa-app/sample-app-sign-in.png)
254255

255-
1. Complete the sign-up or login process.
256-
1. Upon successful login, you should see your profile. From the menu, select **TodoList**.
256+
1. Complete the sign-up or sign-in process.
257+
1. Upon successful sign-in, you should see your profile. From the menu, select **TodoList**.
257258

258259
![Screenshot that shows the Angular sample app with the user profile, and the call to the to-do list.](./media/configure-authentication-sample-angular-spa-app/sample-app-result.png)
259260

@@ -275,4 +276,4 @@ You can add and modify redirect URIs in your registered applications at any time
275276
* [Learn more about the code sample](https://github.com/Azure-Samples/ms-identity-javascript-angular-tutorial/)
276277
* [Enable authentication in your own Angular application](enable-authentication-angular-spa-app.md)
277278
* [Configure authentication options in your Angular application](enable-authentication-angular-spa-app-options.md)
278-
* [Enable authentication in your own web API](enable-authentication-web-api.md)
279+
* [Enable authentication in your own web API](enable-authentication-web-api.md)

0 commit comments

Comments
 (0)