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/active-directory-b2c-configure-signup-self-asserted-custom.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,7 @@ The following elements are used to define the claim:
74
74
75
75
#### DropdownSingleSelect
76
76
77
-

77
+

78
78
79
79
```xml
80
80
<ClaimTypeId="city">
@@ -91,7 +91,7 @@ The following elements are used to define the claim:
91
91
92
92
#### CheckboxMultiSelect
93
93
94
-

94
+

95
95
96
96
```xml
97
97
<ClaimTypeId="city">
@@ -230,7 +230,7 @@ The following elements are used to define the claim:
4. Add the `<OutputClaimClaimTypeReferenceId="city" />` claim to the SignUporSignIn.xml file so that this claim is sent to the application in the token after a successful user journey.
Copy file name to clipboardExpand all lines: articles/active-directory-b2c/active-directory-b2c-custom-rest-api-netfw-secure-basic.md
+24-24Lines changed: 24 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,12 +71,12 @@ Add the `ClientAuthMiddleware.cs` class under the *App_Start* folder. To do so:
71
71
72
72
2. In the **Name** box, type **ClientAuthMiddleware.cs**.
73
73
74
-

74
+

75
75
76
76
3. Open the *App_Start\ClientAuthMiddleware.cs* file, and replace the file content with following code:
77
77
78
78
```csharp
79
-
79
+
80
80
usingMicrosoft.Owin;
81
81
usingSystem;
82
82
usingSystem.Collections.Generic;
@@ -86,7 +86,7 @@ Add the `ClientAuthMiddleware.cs` class under the *App_Start* folder. To do so:
86
86
usingSystem.Text;
87
87
usingSystem.Threading.Tasks;
88
88
usingSystem.Web;
89
-
89
+
90
90
namespaceContoso.AADB2C.API
91
91
{
92
92
/// <summary>
@@ -96,12 +96,12 @@ Add the `ClientAuthMiddleware.cs` class under the *App_Start* folder. To do so:

193
+

Copy file name to clipboardExpand all lines: articles/active-directory-b2c/active-directory-b2c-custom-rest-api-netfw-secure-cert.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,24 +43,24 @@ To set up **Azure App Service** to require client certificates, set the web app
43
43
>For more information about setting the **clientCertEnabled** property, see [Configure TLS mutual authentication for web apps](https://docs.microsoft.com/azure/app-service-web/app-service-web-configure-tls-mutual-auth).
44
44
45
45
## Step 2: Upload your certificate to Azure AD B2C policy keys
46
-
After you set `clientCertEnabled` to *true*, the communication with your RESTful API requires a client certificate. To obtain, upload, and store the client certificate in your Azure AD B2C tenant, do the following:
46
+
After you set `clientCertEnabled` to *true*, the communication with your RESTful API requires a client certificate. To obtain, upload, and store the client certificate in your Azure AD B2C tenant, do the following:
47
47
1. In your Azure AD B2C tenant, select **B2C Settings** > **Identity Experience Framework**.
48
48
49
49
2. To view the keys that are available in your tenant, select **Policy Keys**.
50
50
51
-
3. Select **Add**.
51
+
3. Select **Add**.
52
52
The **Create a key** window opens.
53
53
54
54
4. In the **Options** box, select **Upload**.
55
55
56
-
5. In the **Name** box, type **B2cRestClientCertificate**.
56
+
5. In the **Name** box, type **B2cRestClientCertificate**.
57
57
The prefix *B2C_1A_* is added automatically.
58
58
59
59
6. In the **File upload** box, select your certificate's .pfx file with a private key.
60
60
61
61
7. In the **Password** box, type the certificate's password.

64
64
65
65
7. Select **Create**.
66
66
@@ -81,7 +81,7 @@ To support client certificate authentication in your custom policy, change the t
5. Immediately after the closing `<Metadata>` element, add the following XML snippet:
84
+
5. Immediately after the closing `<Metadata>` element, add the following XML snippet:
85
85
86
86
```xml
87
87
<CryptographicKeys>
@@ -115,12 +115,12 @@ To support client certificate authentication in your custom policy, change the t
115
115
116
116
2. Open **B2C_1A_signup_signin**, the relying party (RP) custom policy that you uploaded, and then select **Run now**.
117
117
118
-
3. Test the process by typing **Test** in the **Given Name** box.
119
-
Azure AD B2C displays an error message at the top of the window.
118
+
3. Test the process by typing **Test** in the **Given Name** box.
119
+
Azure AD B2C displays an error message at the top of the window.
120
120
121
-

121
+

122
122
123
-
4. In the **Given Name** box, type a name (other than "Test").
123
+
4. In the **Given Name** box, type a name (other than "Test").
124
124
Azure AD B2C signs up the user and then sends a loyalty number to your application. Note the number in this JWT example:
125
125
126
126
```
@@ -148,7 +148,7 @@ To support client certificate authentication in your custom policy, change the t
148
148
>If you receive the error message, *The name is not valid, please provide a valid name*, it means that Azure AD B2C successfully called your RESTful service while it presented the client certificate. The next step is to validate the certificate.
149
149
150
150
## Step 6: Add certificate validation
151
-
The client certificate that Azure AD B2C sends to your RESTful service does not undergo validation by the Azure App Service platform, except to check whether the certificate exists. Validating the certificate is the responsibility of the web app.
151
+
The client certificate that Azure AD B2C sends to your RESTful service does not undergo validation by the Azure App Service platform, except to check whether the certificate exists. Validating the certificate is the responsibility of the web app.
152
152
153
153
In this section, you add sample ASP.NET code that validates the certificate properties for authentication purposes.
154
154
@@ -167,7 +167,7 @@ In the Visual Studio project that you created earlier, add the following applica
167
167
Replace the certificate's **Subject name**, **Issuer name**, and **Certificate thumbprint** values with your certificate values.
168
168
169
169
### 6.2 Add the IsValidClientCertificate function
170
-
Open the *Controllers\IdentityController.cs* file, and then add to the `Identity` controller class the following function:
170
+
Open the *Controllers\IdentityController.cs* file, and then add to the `Identity` controller class the following function:
@@ -269,7 +269,7 @@ In the preceding sample code, we accept the certificate as valid only if all the
269
269
>Depending on the sensitivity of your service, you might need to add more validations. For example, you might need to test whether the certificate chains to a trusted root authority, issuer organization name validation, and so on.
270
270
271
271
### 6.3 Call the IsValidClientCertificate function
272
-
Open the *Controllers\IdentityController.cs* file and then, at the beginning of the `SignUp()` function, add the following code snippet:
272
+
Open the *Controllers\IdentityController.cs* file and then, at the beginning of the `SignUp()` function, add the following code snippet:
273
273
274
274
```csharp
275
275
if (IsValidClientCertificate() ==false)
@@ -295,4 +295,4 @@ If you need to troubleshoot this step, see [Collecting logs by using Application
295
295
296
296
## (Optional) Download the complete policy files and code
297
297
* After you complete the [Get started with custom policies](active-directory-b2c-get-started-custom.md) walkthrough, we recommend that you build your scenario by using your own custom policy files. For your reference, we have provided [Sample policy files](https://github.com/Azure-Samples/active-directory-b2c-custom-policy-starterpack/tree/master/scenarios/aadb2c-ief-rest-api-netfw-secure-cert).
298
-
* You can download the complete code from [Sample Visual Studio solution for reference](https://github.com/Azure-Samples/active-directory-b2c-custom-policy-starterpack/tree/master/scenarios/aadb2c-ief-rest-api-netfw/Contoso.AADB2C.API).
298
+
* You can download the complete code from [Sample Visual Studio solution for reference](https://github.com/Azure-Samples/active-directory-b2c-custom-policy-starterpack/tree/master/scenarios/aadb2c-ief-rest-api-netfw/Contoso.AADB2C.API).
0 commit comments