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-overview.md
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,6 @@ This how-to guide series consists of multiple articles. We recommend that you st
41
41
|[Validate custom policy files by using TrustFrameworkPolicy schema](custom-policies-series-install-xml-extensions.md)| Learn how to validate your custom files against a custom policy schema. You also learn how to easily navigate your policy files by using Azure AD B2C Visual Studio Code (VS Code) extension.|
42
42
|[Call a REST API by using Azure Active Directory B2C custom policy](custom-policies-series-call-rest-api.md)| Learn how to write a custom policy that integrates with your own RESTful service.|
43
43
|[Create and read a user account by using Azure Active Directory B2C custom policy](custom-policies-series-store-user.md)| Learn how to store into and read user details from Azure AD storage by using Azure AD B2C custom policy. You use the Azure Active Directory technical profile.|
44
-
|[Read or update a user account by using Azure Active Directory B2C custom policy](custom-policies-series-read-update-user.md)| Learn how to read or update user details in Azure AD storage by using Azure AD B2C custom policy. You use the Azure Active Directory technical profile.|
45
44
|[Set up a sign-up and sign-in flow by using Azure Active Directory B2C custom policy](custom-policies-series-sign-up-or-sign-in.md). | Learn how to configure a sign-up and sign-in flow for a local account(using email and password) by using Azure Active Directory B2C custom policy. You show a user a sign-in interface for them to sign in by using their existing account, but they can create a new account if they don't already have one.|
46
45
|[Set up a sign-up and sign-in flow with a social account by using Azure Active Directory B2C custom policy](custom-policies-series-sign-up-or-sign-in-federation.md)| Learn how to configure a sign-up and sign-in flow for a social account, Facebook.|
Copy file name to clipboardExpand all lines: articles/active-directory-b2c/custom-policies-series-store-user.md
+133-3Lines changed: 133 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -114,6 +114,7 @@ You need to configure two [Azure AD Technical Profile](active-directory-technica
114
114
- *Persisted claims*: The *PersistedClaims* element contains all of the values that should be stored into Azure AD storage.
115
115
116
116
- *InputClaims*: The *InputClaims* element contains a claim, which is used to look up an account in the directory, or create a new one. There must be exactly one input claim element in the input claims collection for all Azure AD technical profiles. This technical profile uses the *email* claim, as the key identifier for the user account. Learn more about [other key identifiers you can use uniquely identify a user account](active-directory-technical-profile.md#inputclaims).
117
+
117
118
118
119
1. In the `ContosoCustomPolicy.XML` file, locate the `AAD-UserWrite` technical profile, and then add a new technical profile after it by using the following code:
119
120
@@ -248,7 +249,7 @@ Since we don't store the `message` claim, in orchestration step `5`, we execute
248
249
249
250
Follow the steps in [Upload custom policy file](custom-policies-series-hello-world.md#step-3---upload-custom-policy-file) to upload your policy file. If you're uploading a file with same name as the one already in the portal, make sure you select **Overwrite the custom policy if it already exists**.
250
251
251
-
## Step 6 - Test policy
252
+
## Step 7 - Test policy
252
253
253
254
Follow the steps in [Test the custom policy](custom-policies-series-validate-user-input.md#step-6---test-the-custom-policy) to test your custom policy.
254
255
@@ -280,9 +281,138 @@ Test your custom policy again by using the same **Email Address**. Instead of th
280
281
> [!NOTE]
281
282
> The *password* claim value is a very important piece of information, so be very careful how you handle it in your custom policy. For a similar reason, Azure AD B2C treats the password claim value as a special value. When you collect the password claim value in the self-asserted technical profile, that value is only available within the same technical profile or within a validation technical profiles that are referenced by that same self-asserted technical profile. Once execution of that self-asserted technical profile completes, and moves to another technical profile, the value is lost.
282
283
283
-
## Validate user email
284
+
## Verify user email
285
+
286
+
We recommend that you verify a user's email before you use it to create a user account. When you verify email addresses, you make sure the accounts are created by real users. You also help users to be sure that they're using their correct email addresses to create an account.
287
+
288
+
Azure AD B2C's custom policy provides a way to verify email address using [verification display control](display-control-verification.md). You send a verification code to the email. After the code has been sent, the user reads the message, enters the verification code into the control provided by the display control, and selects **Verify Code** button.
289
+
290
+
A display control is a user interface element that has special functionality and interacts with the Azure Active Directory B2C (Azure AD B2C) back-end service. It allows the user to perform actions on the page that invoke a validation technical profile at the back end. Display controls are displayed on the page and are referenced by a self-asserted technical profile.
291
+
292
+
To add email verification by using a display control, use the following steps:
293
+
294
+
### Declare claim
295
+
296
+
You need to declare a claim to be used to hold the verifications code.
297
+
298
+
To declare the claim, in the `ContosoCustomPolicy.XML` file, locate the `ClaimsSchema` element and declare `verificationCode` claim by using the following code:
299
+
300
+
```xml
301
+
<!--<ClaimsSchema>-->
302
+
...
303
+
<ClaimTypeId="verificationCode">
304
+
<DisplayName>Verification Code</DisplayName>
305
+
<DataType>string</DataType>
306
+
<UserHelpText>Enter your verification code</UserHelpText>
307
+
<UserInputType>TextBox</UserInputType>
308
+
</ClaimType>
309
+
<!--</ClaimsSchema>-->
310
+
```
311
+
312
+
### Configure a send and verify code technical profile
313
+
314
+
Azure AD B2C uses [Azure AD SSPR technical profile](aad-sspr-technical-profile.md) to verify an email address. This technical profile can generate and send a code to an email address or verifies the code depending on how you configure it.
315
+
316
+
In the `ContosoCustomPolicy.XML` file, locate the `ClaimsProviders` element and add the a claims provider by using the following code:
317
+
318
+
```xml
319
+
<ClaimsProvider>
320
+
<DisplayName>Azure AD self-service password reset (SSPR)</DisplayName>
We've configured two technical profiles `AadSspr-SendCode` and `AadSspr-VerifyCode`. `AadSspr-SendCode` generates and sends a code to the email address address specified in the `InputClaims` section whereas `AadSspr-VerifyCode` verifies the code. You specify the action you want to perform in th technical profile's metadata.
348
+
349
+
### Configure a display control
350
+
351
+
You need to configure an email verification display control to be able to verify users email. The email verification display control you configure will replace the email display claim that you use to collect an email from the user.
352
+
353
+
To configure a display control, use the following steps:
354
+
355
+
1. In the `ContosoCustomPolicy.XML` file, locate the `BuildingBlocks` section, and then add a display control as a child element by using the following code:
We've declared a display control, `emailVerificationControl`. Take note of the following important parts:
385
+
386
+
- *DisplayClaims* - Just like in a self-asserted technical profile, this section specifies a collection of claims to be collected from the user within the display control.
387
+
388
+
- *Actions* - Specifies the order of actions to be performed by the display control. Each action references a technical profile that responsible to perform the actions. For example, the *SendCode* references the `AadSspr-SendCode` technical profile, which generates and sends a code to an email address.
389
+
390
+
1. In the `ContosoCustomPolicy.XML` file, locate the `UserInformationCollector` self-asserted technical profile and replace the *email* display claim to `emailVerificationControl` display control:
1. Use the the procedure in [step 6](#step-6---upload-policy) and [step 7](#step-7---test-policy) to upload you policy file, and test it. This time, you must verify your email address before a user account is created.
405
+
406
+
## Update user account by using Azure AD technical profile
407
+
408
+
You can configure a Azure AD technical profile to update a user account instead of attempting to create a new one. To do so, set the Azure AD technical profile to throw an error if the specified user account doesn't already exist in the `Metadata` collection by using the following code. The *Operation* needs to be set to *Write*:
In this article, you've learnt how to store user details using [built-in User profile attributes](user-profile-attributes.md). However, you often need to create your own custom attributes to manage your specific scenario. To do so, follow the instructions in [Define custom attributes in Azure Active Directory B2C](user-flow-custom-attributes.md) article.
0 commit comments