Skip to content

Commit fca5b02

Browse files
authored
Merge pull request #174114 from kengaderdus/content-freshness-on-stale-articles-b2c-1
[identity][AAD][B2C]Content freshness on stale articles b2c Cont'
2 parents 099b35e + c5b3f1c commit fca5b02

File tree

7 files changed

+40
-35
lines changed

7 files changed

+40
-35
lines changed

articles/active-directory-b2c/best-practices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: celestedg
99
ms.service: active-directory
1010
ms.workload: identity
1111
ms.topic: conceptual
12-
ms.date: 06/06/2020
12+
ms.date: 10/01/2021
1313
ms.author: vigunase
1414
ms.subservice: B2C
1515
---

articles/active-directory-b2c/implicit-flow-single-page-application.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ ms.subservice: B2C
1616

1717
# Single-page sign in using the OAuth 2.0 implicit flow in Azure Active Directory B2C
1818

19-
Many modern applications have a single-page app front end that is written primarily in JavaScript. Often, the app is written by using a framework like React, Angular, or Vue.js. Single-page apps and other JavaScript apps that run primarily in a browser have some additional challenges for authentication:
19+
Many modern applications have a single-page app (SPA) front end that is written primarily in JavaScript. Often, the app is written by using a framework like React, Angular, or Vue.js. SPAs and other JavaScript apps that run primarily in a browser have some additional challenges for authentication:
2020

2121
- The security characteristics of these apps are different from traditional server-based web applications.
2222
- Many authorization servers and identity providers do not support cross-origin resource sharing (CORS) requests.
2323
- Full-page browser redirects away from the app can be invasive to the user experience.
2424

25-
The recommended way of supporting single-page applications is [OAuth 2.0 Authorization code flow (with PKCE)](./authorization-code-flow.md).
25+
The recommended way of supporting SPAs is [OAuth 2.0 Authorization code flow (with PKCE)](./authorization-code-flow.md).
2626

2727
Some frameworks, like [MSAL.js 1.x](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-core), only support the implicit grant flow. In these cases, Azure Active Directory B2C (Azure AD B2C) supports the OAuth 2.0 authorization implicit grant flow. The flow is described in [section 4.2 of the OAuth 2.0 specification](https://tools.ietf.org/html/rfc6749). In implicit flow, the app receives tokens directly from the Azure Active Directory (Azure AD) authorize endpoint, without any server-to-server exchange. All authentication logic and session handling is done entirely in the JavaScript client with either a page redirect or a pop-up box.
2828

@@ -64,7 +64,7 @@ client_id=90c0fe63-bcf2-44d5-8fb7-b8bbc0b29dc6
6464

6565
At this point, the user is asked to complete the policy's workflow. The user might have to enter their username and password, sign in with a social identity, sign up for the directory, or any other number of steps. User actions depend on how the user flow is defined.
6666

67-
After the user completes the user flow, Azure AD returns a response to your app at the value you used for `redirect_uri`. It uses the method specified in the `response_mode` parameter. The response is exactly the same for each of the user action scenarios, independent of the user flow that was executed.
67+
After the user completes the user flow, Azure AD B2C returns a response to your app at the value you used for `redirect_uri`. It uses the method specified in the `response_mode` parameter. The response is exactly the same for each of the user action scenarios, independent of the user flow that was executed.
6868

6969
### Successful response
7070
A successful response that uses `response_mode=fragment` and `response_type=id_token+token` looks like the following, with line breaks for legibility:
@@ -122,7 +122,9 @@ One of the properties of this configuration document is the `jwks_uri`. The valu
122122
https://fabrikamb2c.b2clogin.com/fabrikamb2c.onmicrosoft.com/b2c_1_sign_in/discovery/v2.0/keys
123123
```
124124

125-
To determine which user flow was used to sign an ID token (and where to fetch the metadata from), you have two options. First, the user flow name is included in the `acr` claim in `id_token`. For information about how to parse the claims from an ID token, see the [Azure AD B2C token reference](tokens-overview.md). Your other option is to encode the user flow in the value of the `state` parameter when you issue the request. Then, decode the `state` parameter to determine which user flow was used. Either method is valid.
125+
To determine which user flow was used to sign an ID token (and where to fetch the metadata from), you have two options:
126+
- The user flow name is included in the `acr` claim in `id_token`. For information about how to parse the claims from an ID token, see the [Azure AD B2C token reference](tokens-overview.md).
127+
- Encode the user flow in the value of the `state` parameter when you issue the request. Then, decode the `state` parameter to determine which user flow was used. Either method is valid.
126128

127129
After you've acquired the metadata document from the OpenID Connect metadata endpoint, you can use the RSA-256 public keys (located at this endpoint) to validate the signature of the ID token. There might be multiple keys listed at this endpoint at any given time, each identified by a `kid`. The header of `id_token` also contains a `kid` claim. It indicates which of these keys was used to sign the ID token. For more information, including learning about [validating tokens](tokens-overview.md), see the [Azure AD B2C token reference](tokens-overview.md).
128130
<!--TODO: Improve the information on this-->
@@ -146,7 +148,7 @@ After you have validated the ID token, you can begin a session with the user. In
146148
## Get access tokens
147149
If the only thing your web apps needs to do is execute user flows, you can skip the next few sections. The information in the following sections is applicable only to web apps that need to make authenticated calls to a web API, and which are protected by Azure AD B2C.
148150

149-
Now that you've signed the user into your single-page app, you can get access tokens for calling web APIs that are secured by Azure AD. Even if you have already received a token by using the `token` response type, you can use this method to acquire tokens for additional resources without redirecting the user to sign in again.
151+
Now that you've signed the user into your SPA, you can get access tokens for calling web APIs that are secured by Azure AD. Even if you have already received a token by using the `token` response type, you can use this method to acquire tokens for additional resources without redirecting the user to sign in again.
150152

151153
In a typical web app flow, you would make a request to the `/token` endpoint. However, the endpoint does not support CORS requests, so making AJAX calls to get a refresh token is not an option. Instead, you can use the implicit flow in a hidden HTML iframe element to get new tokens for other web APIs. Here's an example, with line breaks for legibility:
152154

@@ -241,4 +243,4 @@ GET https://{tenant}.b2clogin.com/{tenant}.onmicrosoft.com/{policy}/oauth2/v2.0/
241243
242244
## Next steps
243245

244-
See the code sample: [Sign-in with Azure AD B2C in a JavaScript single-page application](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-core-samples/VanillaJSTestApp/app/b2c).
246+
See the code sample: [Sign-in with Azure AD B2C in a JavaScript SPA](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-core-samples/VanillaJSTestApp/app/b2c).

articles/active-directory-b2c/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ms.subservice: B2C
1515

1616
# What is Azure Active Directory B2C?
1717

18-
Azure Active Directory Business-to-consumer (Azure AD B2C) provides business-to-customer identity as a service. Your customers use their preferred social, enterprise, or local account identities to get single sign-on access to your applications and APIs.
18+
Azure Active Directory B2C provides business-to-customer identity as a service. Your customers use their preferred social, enterprise, or local account identities to get single sign-on access to your applications and APIs.
1919

2020
![Infographic of Azure AD B2C identity providers and downstream applications](./media/overview/azureadb2c-overview.png)
2121

articles/active-directory-b2c/protocols-overview.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ https://{tenant}.b2clogin.com/{tenant}.onmicrosoft.com/oauth2/v2.0/token
3636

3737
In nearly all OAuth and OpenID Connect flows, four parties are involved in the exchange:
3838

39-
![Diagram showing the four OAuth 2.0 Roles](./media/protocols-overview/protocols_roles.png)
39+
40+
41+
42+
:::image type="content" source="./media/protocols-overview/protocols_roles.png" alt-text="Diagram showing the four OAuth 2.0 Roles.":::
4043

4144
* The **authorization server** is the Azure AD endpoint. It securely handles anything related to user information and access. It also handles the trust relationships between the parties in a flow. It is responsible for verifying the user's identity, granting and revoking access to resources, and issuing tokens. It is also known as the identity provider.
4245

articles/active-directory-b2c/quickstart-single-page-app.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,20 @@ ms.subservice: B2C
1616

1717
# Quickstart: Set up sign in for a single-page app using Azure Active Directory B2C
1818

19-
Azure Active Directory B2C (Azure AD B2C) provides cloud identity management to keep your application, business, and customers protected. Azure AD B2C enables your applications to authenticate to social accounts, and enterprise accounts using open standard protocols. In this quickstart, you use a single-page application to sign in using a social identity provider and call an Azure AD B2C protected web API.
19+
Azure Active Directory B2C (Azure AD B2C) provides cloud identity management to keep your application, business, and customers protected. Azure AD B2C enables your applications to authenticate to social accounts, and enterprise accounts using open standard protocols.
2020

21-
[!INCLUDE [quickstarts-free-trial-note](../../includes/quickstarts-free-trial-note.md)]
21+
In this quickstart, you use a single-page application to sign in using a social identity provider and call an Azure AD B2C protected web API.
22+
23+
<!--[!INCLUDE [quickstarts-free-trial-note](../../includes/quickstarts-free-trial-note.md)] -->
2224

2325
## Prerequisites
2426

2527
- [Visual Studio Code](https://code.visualstudio.com/)
2628
- [Node.js](https://nodejs.org/en/download/)
2729
- Social account from Facebook, Google, or Microsoft
28-
- Code sample from GitHub: [ms-identity-b2c-javascript-spa](https://github.com/Azure-Samples/ms-identity-b2c-javascript-spa)
30+
- Code sample from GitHub: [ms-identity-b2c-javascript-spa](https://github.com/Azure-Samples/ms-identity-b2c-javascript-spa):
2931

30-
You can [download the zip archive](https://github.com/Azure-Samples/ms-identity-b2c-javascript-spa/archive/main.zip) or clone the repository:
32+
You can [download the zip archive](https://github.com/Azure-Samples/ms-identity-b2c-javascript-spa/archive/main.zip) or clone the repository
3133

3234
```console
3335
git clone https://github.com/Azure-Samples/ms-identity-b2c-javascript-spa.git
@@ -38,7 +40,8 @@ Azure Active Directory B2C (Azure AD B2C) provides cloud identity management to
3840
1. Start the server by running the following commands from the Node.js command prompt:
3941

4042
```console
41-
npm install && npm update
43+
npm install
44+
npm update
4245
npm start
4346
```
4447

@@ -71,19 +74,16 @@ Select **Call API** to have your display name returned from the web API as a JSO
7174

7275
The sample single-page application includes an access token in the request to the protected web API resource.
7376

74-
## Clean up resources
77+
<!-- ## Clean up resources
7578

76-
You can use your Azure AD B2C tenant if you plan to try other Azure AD B2C quickstarts or tutorials. When no longer needed, you can [delete your Azure AD B2C tenant](faq.yml#how-do-i-delete-my-azure-ad-b2c-tenant-).
79+
You can use your Azure AD B2C tenant if you plan to try other Azure AD B2C quickstarts or tutorials. When no longer needed, you can [delete your Azure AD B2C tenant](faq.yml#how-do-i-delete-my-azure-ad-b2c-tenant-).-->
7780

7881
## Next steps
7982

80-
In this quickstart, you used a sample single-page application to:
83+
<!---In this quickstart, you used a sample single-page application to:
8184

8285
- Sign in with a social identity provider
8386
- Create an Azure AD B2C user account (created automatically at sign-in)
84-
- Call a web API protected by Azure AD B2C
85-
86-
Get started creating your own Azure AD B2C tenant.
87+
- Call a web API protected by Azure AD B2C -->
8788

88-
> [!div class="nextstepaction"]
89-
> [Create an Azure Active Directory B2C tenant in the Azure portal](tutorial-create-tenant.md)
89+
- Get started creating your own [Azure Active Directory B2C tenant in the Azure portal](tutorial-create-tenant.md)

0 commit comments

Comments
 (0)