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-b2c/custom-policies-series-branch-user-journey.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -229,7 +229,7 @@ Follow the steps in [Test the custom policy](custom-policies-series-validate-use
229
229
230
230
1. In the first screen, for **Account Type**, select **Personal Account**.
231
231
1. For **Access Code**, enter *88888*, and then select **Continue**.
232
-
1. Enter the rest of the details as required, and then select **Continue**. After the policy finishes execution, you're redirected to `https://jwt.ms`, and you see a decoded JWT token.
232
+
1. Enter the rest of the details as required, and then select **Continue**. After the policy finishes execution, you're redirected to `https://jwt.ms`, and you see a decoded JWT.
233
233
1. Repeat step 5, but this time, select **Account Type**, select **Contoso Employee Account**, and then follow the prompts.
Copy file name to clipboardExpand all lines: articles/active-directory-b2c/custom-policies-series-call-rest-api.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ In this article, you learn how to:
35
35
36
36
## Scenario overview
37
37
38
-
In [Create branching in user journey by using Azure AD B2C custom policies](custom-policies-series-branch-user-journey.md), users who select *Personal Account* need to provide a valid invitation access code to proceed. We use a static access code, but real world apps don't work this way. If the service that issues the access codes is external to your custom policy, you must make a call to that service, and pass the access code input by the user for validation. If the access code is valid, the service returns an HTTP `200 OK` response, and Azure AD B2C issues JWT token. Otherwise, the service returns an HTTP 4xx response, and the user must reenter an access code.
38
+
In [Create branching in user journey by using Azure AD B2C custom policies](custom-policies-series-branch-user-journey.md), users who select *Personal Account* need to provide a valid invitation access code to proceed. We use a static access code, but real world apps don't work this way. If the service that issues the access codes is external to your custom policy, you must make a call to that service, and pass the access code input by the user for validation. If the access code is valid, the service returns an HTTP `200 OK` response, and Azure AD B2C issues JWT. Otherwise, the service returns an HTTP 4xx response, and the user must reenter an access code.
39
39
40
40
:::image type="content" source="media/custom-policies-series-call-rest-api/screenshot-of-call-rest-api-call.png" alt-text="A flowchart of calling a R E S T A P I.":::
41
41
@@ -228,7 +228,7 @@ Follow the steps in [Test the custom policy](custom-policies-series-validate-use
228
228
229
229
1. For **Account Type**, select **Personal Account**
230
230
1. Enter the rest of the details as required, and then select **Continue**. You see a new screen.
231
-
1. For **Access Code**, enter *88888*, and then select **Continue**. After the policy finishes execution, you're redirected to `https://jwt.ms`, and you see a decoded JWTtoken. If you repeat the procedure, and enter a different **Access Code**, other than *88888*, you see an error, **The access code you entered is incorrect. Pleasetry again.**
231
+
1. For **Access Code**, enter *88888*, and then select **Continue**. After the policy finishes execution, you're redirected to `https://jwt.ms`, and you see a decoded JWT. If you repeat the procedure, and enter a different **Access Code**, other than *88888*, you see an error, **The access code you entered is incorrect. Pleasetry again.**
Copy file name to clipboardExpand all lines: articles/active-directory-b2c/custom-policies-series-collect-user-input.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,15 +16,15 @@ ms.reviewer: yoelh
16
16
ms.subservice: b2c
17
17
18
18
19
-
#Customer intent: As a developer using Azure Active Directory B2C, I want to collect and manipulate user inputs by writing a custom policy, so that I can customize the user interface and process the inputs as claims in a JWT token.
19
+
#Customer intent: As a developer using Azure Active Directory B2C, I want to collect and manipulate user inputs by writing a custom policy, so that I can customize the user interface and process the inputs as claims in a JWT.
20
20
21
21
---
22
22
23
23
# Collect and manipulate user inputs by using Azure Active Directory B2C custom policy
24
24
25
25
Azure Active Directory B2C (Azure AD B2C) custom policies allows you to collect user inputs. You can then use inbuilt methods to manipulate the user inputs.
26
26
27
-
In this article, you learn how to write a custom policy that collects user inputs via a graphical user interface. You'll then access the inputs, process then, and finally return them as claims in a JWT token. To complete this task, you'll:
27
+
In this article, you learn how to write a custom policy that collects user inputs via a graphical user interface. You'll then access the inputs, process then, and finally return them as claims in a JWT. To complete this task, you'll:
28
28
29
29
- Declare claims. A claim provides temporary storage of data during an Azure AD B2C policy execution. It can store information about the user, such as first name, last name, or any other claim obtained from the user or other systems. You can learn more about claims in the [Azure AD B2C custom policy overview](custom-policy-overview.md#claims).
30
30
@@ -260,7 +260,7 @@ Replace the existing contents of the `HelloWorldJourney` User Journey with the f
260
260
</OrchestrationSteps>
261
261
```
262
262
263
-
According to the orchestration steps, we collect user inputs, set values for *objectId*, *displayName* and *message* claims, and finally send the Jwt token.
263
+
According to the orchestration steps, we collect user inputs, set values for *objectId*, *displayName* and *message* claims, and finally send the JWT.
264
264
265
265
## Step 6 - Update relying party
266
266
@@ -486,7 +486,7 @@ Follow the steps in [Upload custom policy file](custom-policies-series-hello-wor
486
486
487
487
:::image type="content" source="media/custom-policies-series-collect-user-input/screenshot-of-accepting-user-inputs-in-custom-policy.png" alt-text="screenshot of accepting user inputs in custom policy.":::
488
488
489
-
After the policy finishes execution, you're redirected to `https://jwt.ms`, and you see a decoded JWT token. It looks similar to the following JWT token snippet:
489
+
After the policy finishes execution, you're redirected to `https://jwt.ms`, and you see a decoded JWT. It looks similar to the following JWT snippet:
Copy file name to clipboardExpand all lines: articles/active-directory-b2c/custom-policies-series-hello-world.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -141,7 +141,7 @@ If you haven't already done so, create the following encryption keys. To automat
141
141
</ClaimsProvider>
142
142
```
143
143
144
-
We've declared a JWT Token Issuer. In the `CryptographicKeys` section, if you used different names to configure the signing and encryption keys in [step 1](#step-1---configure-the-signing-and-encryption-keys), make sure you use the correct value for the `StorageReferenceId`.
144
+
We've declared a JWT Issuer. In the `CryptographicKeys` section, if you used different names to configure the signing and encryption keys in [step 1](#step-1---configure-the-signing-and-encryption-keys), make sure you use the correct value for the `StorageReferenceId`.
145
145
146
146
1. In the `UserJourneys` section of the `ContosoCustomPolicy.XML` file, add the following code:
147
147
@@ -267,7 +267,7 @@ After you upload the file, Azure AD B2C adds the prefix `B2C_1A_`, so the names
267
267
1. For **Select application** on the overview page of the custom policy, select the web application such as *webapp1* that you previously registered. Make sure that the **Select reply URL** value is set to`https://jwt.ms`.
268
268
1. Select **Run now** button.
269
269
270
-
After the policy finishes execution, you're redirected to `https://jwt.ms`, and you see a decoded JWT token. It looks similar to the following JWT token snippet:
270
+
After the policy finishes execution, you're redirected to `https://jwt.ms`, and you see a decoded JWT. It looks similar to the following JWT snippet:
Copy file name to clipboardExpand all lines: articles/active-directory-b2c/custom-policies-series-overview.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ This how-to guide series consists of multiple articles. We recommend that you st
38
38
39
39
|Article | What you'll learn |
40
40
|---------|---------|
41
-
|[Write your first Azure Active Directory B2C custom policy - Hello World!](custom-policies-series-hello-world.md)| Write your first Azure AD B2C custom policy. You return the message *Hello World!* in the JWT token. |
41
+
|[Write your first Azure Active Directory B2C custom policy - Hello World!](custom-policies-series-hello-world.md)| Write your first Azure AD B2C custom policy. You return the message *Hello World!* in the JWT. |
42
42
|[Collect and manipulate user inputs by using Azure AD B2C custom policy](custom-policies-series-collect-user-input.md)| Learn how to collect inputs from users, and how to manipulate them.|
43
43
|[Validate user inputs by using Azure Active Directory B2C custom policy](custom-policies-series-validate-user-input.md)| Learn how to validate user inputs by using techniques such as limiting user input options, regular expressions, predicates, and validation technical profiles|
44
44
|[Create branching in user journey by using Azure Active Directory B2C custom policy](custom-policies-series-branch-user-journey.md)| Learn how to create different user experiences for different users based on the value of a claim.|
Copy file name to clipboardExpand all lines: articles/active-directory-b2c/custom-policies-series-sign-up-or-sign-in-federation.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -452,7 +452,7 @@ When the custom policy runs:
452
452
453
453
-**Orchestration Step 5** - This step runs if the user doesn't already exist (`objectId` doesn't exist), so the `AAD-UserWriteUsingAlternativeSecurityId` Technical Profile executes to write the social account into Microsoft Entra ID.
454
454
455
-
-**Orchestration Step 6** - Finally, step 6 assembles and returns the JWT token at the end of the policy’s execution.
455
+
-**Orchestration Step 6** - Finally, step 6 assembles and returns the JWT at the end of the policy’s execution.
456
456
457
457
## Step 5 - Update relying party output claims
458
458
@@ -466,7 +466,7 @@ In the `ContosoCustomPolicy.XML` file, locate the `RelyingParty` element, and th
We've added the identity provider (*identityProvider*) as an output claim, so it will be included in the JWT token returned to the relying party application.
469
+
We've added the identity provider (*identityProvider*) as an output claim, so it will be included in the JWT returned to the relying party application.
470
470
471
471
## Step 6 - Upload policy
472
472
@@ -485,7 +485,7 @@ If it's the first time running this policy (social account doesn't already exist
485
485
486
486
Enter or update **Display Name**, **Given Name** and the **Surname**, and then select **Continue** button.
487
487
488
-
After the policy finishes execution, you're redirected to https://jwt.ms, and you see a decoded JWT token. It looks similar to the following JWT token snippet:
488
+
After the policy finishes execution, you're redirected to https://jwt.ms, and you see a decoded JWT. It looks similar to the following JWT snippet:
489
489
490
490
```json
491
491
{
@@ -504,7 +504,7 @@ After the policy finishes execution, you're redirected to https://jwt.ms, and yo
504
504
}.[Signature]
505
505
```
506
506
507
-
Notice the identity provider, `"idp": "facebook.com"`, has been included in the JWT token.
507
+
Notice the identity provider, `"idp": "facebook.com"`, has been included in the JWT.
Copy file name to clipboardExpand all lines: articles/active-directory-b2c/custom-policies-series-store-user.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,19 +16,19 @@ ms.reviewer: yoelh
16
16
ms.subservice: b2c
17
17
18
18
19
-
#Customer intent: As a developer using Azure Active Directory B2C, I want to create and read user accounts using custom policies, so that I can store and retrieve user information from Microsoft Entra ID storage and issue JWT tokens.
19
+
#Customer intent: As a developer using Azure Active Directory B2C, I want to create and read user accounts using custom policies, so that I can store and retrieve user information from Microsoft Entra ID storage and issue JWTs.
20
20
21
21
---
22
22
23
23
# Create and read a user account by using Azure Active Directory B2C custom policy
24
24
25
25
Azure Active Directory B2C (Azure AD B2C) is built on Microsoft Entra ID, and so it uses Microsoft Entra ID storage to store user accounts. Azure AD B2C directory user profile comes with a built-in set of attributes, such as given name, surname, city, postal code, and phone number, but you can [extend the user profile with your own custom attributes](user-flow-custom-attributes.md) without requiring an external data store.
26
26
27
-
Your custom policy can connect to Microsoft Entra ID storage by using [Microsoft Entra ID technical profile](active-directory-technical-profile.md) to store, update or delete user information. In this article, you learn how to configure a set of Microsoft Entra ID technical profiles to store and read a user account before a JWT token is returned.
27
+
Your custom policy can connect to Microsoft Entra ID storage by using [Microsoft Entra ID technical profile](active-directory-technical-profile.md) to store, update or delete user information. In this article, you learn how to configure a set of Microsoft Entra ID technical profiles to store and read a user account before a JWT is returned.
28
28
29
29
## Scenario overview
30
30
31
-
In [Call a REST API by using Azure Active Directory B2C custom policy](custom-policies-series-call-rest-api.md) article, we collect information from the user, validated the data, called a REST API, and finally returned a JWT without storing a user account. We must store the user information so that we don't lose the information once the policy finishes execution. This time, once we collect the user information and validate it, we need to store the user information in Azure AD B2C storage, and then read before we return the JWT token. The complete process is shown in the following diagram.
31
+
In [Call a REST API by using Azure Active Directory B2C custom policy](custom-policies-series-call-rest-api.md) article, we collect information from the user, validated the data, called a REST API, and finally returned a JWT without storing a user account. We must store the user information so that we don't lose the information once the policy finishes execution. This time, once we collect the user information and validate it, we need to store the user information in Azure AD B2C storage, and then read before we return the JWT. The complete process is shown in the following diagram.
32
32
33
33
34
34
:::image type="content" source="media/custom-policies-series-store-user/screenshot-create-user-record.png" alt-text="A flowchart of creating a user account in Azure AD.":::
@@ -156,7 +156,7 @@ After we collect user details by using the `UserInformationCollector` self-asser
156
156
157
157
In the `ContosoCustomPolicy.XML` file, locate the `UserInformationCollector` technical profile, and then add `AAD-UserWrite` technical profile as a validation technical profile in the `ValidationTechnicalProfiles` collection. You need to add this after the `CheckCompanyDomain` validation technical profile.
158
158
159
-
We'll use the `AAD-UserRead` technical profile in the user journey orchestration steps to read the user details before issuing a JWT token.
159
+
We'll use the `AAD-UserRead` technical profile in the user journey orchestration steps to read the user details before issuing a JWT.
160
160
161
161
## Step 4 - Update the ClaimGenerator technical profile
162
162
@@ -189,7 +189,7 @@ We use the `ClaimGenerator` technical profile to execute three claims transforma
189
189
</OutputClaimsTransformations>
190
190
</TechnicalProfile>
191
191
```
192
-
We've broken the technical profile into two separate technical profiles. The *UserInputMessageClaimGenerator* technical profile generates the message sent as claim in the JWT token. The *UserInputDisplayNameGenerator* technical profile generates the `displayName` claim. The `displayName` claim value must be available before the `AAD-UserWrite` technical profile writes the user record into Microsoft Entra ID storage. In the new code, we remove the *GenerateRandomObjectIdTransformation* as the `objectId` is created and returned by Microsoft Entra ID after an account is created, so we don't need to generate it ourselves within the policy.
192
+
We've broken the technical profile into two separate technical profiles. The *UserInputMessageClaimGenerator* technical profile generates the message sent as claim in the JWT. The *UserInputDisplayNameGenerator* technical profile generates the `displayName` claim. The `displayName` claim value must be available before the `AAD-UserWrite` technical profile writes the user record into Microsoft Entra ID storage. In the new code, we remove the *GenerateRandomObjectIdTransformation* as the `objectId` is created and returned by Microsoft Entra ID after an account is created, so we don't need to generate it ourselves within the policy.
193
193
194
194
1. In the `ContosoCustomPolicy.XML` file, locate the `UserInformationCollector` self-asserted technical profile, and then add the `UserInputDisplayNameGenerator` technical profile as a validation technical profile. After you do so, the `UserInformationCollector` technical profile's `ValidationTechnicalProfiles` collection should look similar to the following code:
195
195
@@ -249,9 +249,9 @@ Locate your `HelloWorldJourney` user journey and replace all the orchestration s
249
249
<!--</OrchestrationSteps>-->
250
250
```
251
251
252
-
In orchestration step `4`, we execute the `AAD-UserRead` technical profile to read the user details (to be included in the JWT token) from the created user account.
252
+
In orchestration step `4`, we execute the `AAD-UserRead` technical profile to read the user details (to be included in the JWT) from the created user account.
253
253
254
-
Since we don't store the `message` claim, in orchestration step `5`, we execute the `UserInputMessageClaimGenerator` to generate the `message` claim for inclusion on the JWT token.
254
+
Since we don't store the `message` claim, in orchestration step `5`, we execute the `UserInputMessageClaimGenerator` to generate the `message` claim for inclusion on the JWT.
Copy file name to clipboardExpand all lines: articles/active-directory-b2c/custom-policies-series-validate-user-input.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -357,7 +357,7 @@ Follow the steps in [Upload custom policy file](custom-policies-series-hello-wor
357
357
358
358
You must correct your inputs before you continue.
359
359
360
-
1. Enter correct values as suggested by the error messages, and then select **Continue** button again. After the policy finishes execution, you're redirected to `https://jwt.ms`, and you see a decoded JWT token. The token looks similar to the following JWT token snippet:
360
+
1. Enter correct values as suggested by the error messages, and then select **Continue** button again. After the policy finishes execution, you're redirected to `https://jwt.ms`, and you see a decoded JWT. The token looks similar to the following JWT snippet:
361
361
362
362
```json
363
363
{
@@ -482,7 +482,7 @@ Use the following steps to learn how to validate user input by using validation
482
482
1. For **Email Address**, enter an invalid email address such as *[email protected]*.
483
483
1. Enter the rest of the details as required and select **Continue**
484
484
485
-
Since *[email protected]* isn't a valid email, you'll see an error similar to the one shown in the screenshot below. You must use a valid email address to successfully run the custom policy and receive a JWT token.
485
+
Since *[email protected]* isn't a valid email, you'll see an error similar to the one shown in the screenshot below. You must use a valid email address to successfully run the custom policy and receive a JWT.
486
486
487
487
:::image type="content" source="media/custom-policies-series-validate-user-input/screenshot-of-error-due-to-invalid-email-address.png" alt-text="screenshot of error due to invalid email address.":::
0 commit comments