Skip to content

Commit 8a03dd4

Browse files
Merge pull request #81966 from mmacy/img-alt-text-fix
[b2c] alt text fixes 01
2 parents 7073d77 + 3edba76 commit 8a03dd4

10 files changed

+112
-112
lines changed

articles/active-directory-b2c/active-directory-b2c-configure-signup-self-asserted-custom.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ The following elements are used to define the claim:
7474

7575
#### DropdownSingleSelect
7676

77-
![Screenshot of dropdown option](./media/active-directory-b2c-configure-signup-self-asserted-custom/dropdown-menu-example.png)
77+
![Single-select dropdown control showing several options](./media/active-directory-b2c-configure-signup-self-asserted-custom/dropdown-menu-example.png)
7878

7979
```xml
8080
<ClaimType Id="city">
@@ -91,7 +91,7 @@ The following elements are used to define the claim:
9191

9292
#### CheckboxMultiSelect
9393

94-
![Screenshot of multiselect option](./media/active-directory-b2c-configure-signup-self-asserted-custom/multiselect-menu-example.png)
94+
![Multi-select checkbox control showing several options](./media/active-directory-b2c-configure-signup-self-asserted-custom/multiselect-menu-example.png)
9595

9696
```xml
9797
<ClaimType Id="city">
@@ -230,7 +230,7 @@ The following elements are used to define the claim:
230230
<IncludeTechnicalProfile ReferenceId="AAD-Common" />
231231
</TechnicalProfile>
232232
```
233-
233+
234234
4. Add the `<OutputClaim ClaimTypeReferenceId="city" />` claim to the SignUporSignIn.xml file so that this claim is sent to the application in the token after a successful user journey.
235235

236236
```xml

articles/active-directory-b2c/active-directory-b2c-custom-rest-api-netfw-secure-basic.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ Add the `ClientAuthMiddleware.cs` class under the *App_Start* folder. To do so:
7171

7272
2. In the **Name** box, type **ClientAuthMiddleware.cs**.
7373

74-
![Create new C# class](media/aadb2c-ief-rest-api-netfw-secure-basic/rest-api-netfw-secure-basic-OWIN-startup-auth2.png)
74+
![Creating a new C# class in the Add New Item dialog in Visual Studio](media/aadb2c-ief-rest-api-netfw-secure-basic/rest-api-netfw-secure-basic-OWIN-startup-auth2.png)
7575

7676
3. Open the *App_Start\ClientAuthMiddleware.cs* file, and replace the file content with following code:
7777

7878
```csharp
79-
79+
8080
using Microsoft.Owin;
8181
using System;
8282
using System.Collections.Generic;
@@ -86,7 +86,7 @@ Add the `ClientAuthMiddleware.cs` class under the *App_Start* folder. To do so:
8686
using System.Text;
8787
using System.Threading.Tasks;
8888
using System.Web;
89-
89+
9090
namespace Contoso.AADB2C.API
9191
{
9292
/// <summary>
@@ -96,12 +96,12 @@ Add the `ClientAuthMiddleware.cs` class under the *App_Start* folder. To do so:
9696
{
9797
private static readonly string ClientID = ConfigurationManager.AppSettings["WebApp:ClientId"];
9898
private static readonly string ClientSecret = ConfigurationManager.AppSettings["WebApp:ClientSecret"];
99-
99+
100100
/// <summary>
101101
/// Gets or sets the next owin middleware
102102
/// </summary>
103103
private Func<IDictionary<string, object>, Task> Next { get; set; }
104-
104+
105105
/// <summary>
106106
/// Initializes a new instance of the <see cref="ClientAuthMiddleware"/> class.
107107
/// </summary>
@@ -110,7 +110,7 @@ Add the `ClientAuthMiddleware.cs` class under the *App_Start* folder. To do so:
110110
{
111111
this.Next = next;
112112
}
113-
113+
114114
/// <summary>
115115
/// Invoke client authentication middleware during each request.
116116
/// </summary>
@@ -120,29 +120,29 @@ Add the `ClientAuthMiddleware.cs` class under the *App_Start* folder. To do so:
120120
{
121121
// Get wrapper class for the environment
122122
var context = new OwinContext(environment);
123-
123+
124124
// Check whether the authorization header is available. This contains the credentials.
125125
var authzValue = context.Request.Headers.Get("Authorization");
126126
if (string.IsNullOrEmpty(authzValue) || !authzValue.StartsWith("Basic ", StringComparison.OrdinalIgnoreCase))
127127
{
128128
// Process next middleware
129129
return Next(environment);
130130
}
131-
131+
132132
// Get credentials
133133
var creds = authzValue.Substring("Basic ".Length).Trim();
134134
string clientId;
135135
string clientSecret;
136-
136+
137137
if (RetrieveCreds(creds, out clientId, out clientSecret))
138138
{
139139
// Set transaction authenticated as client
140140
context.Request.User = new GenericPrincipal(new GenericIdentity(clientId, "client"), new string[] { "client" });
141141
}
142-
142+
143143
return Next(environment);
144144
}
145-
145+
146146
/// <summary>
147147
/// Retrieve credentials from header
148148
/// </summary>
@@ -154,7 +154,7 @@ Add the `ClientAuthMiddleware.cs` class under the *App_Start* folder. To do so:
154154
{
155155
string pair;
156156
clientId = clientSecret = string.Empty;
157-
157+
158158
try
159159
{
160160
pair = Encoding.UTF8.GetString(Convert.FromBase64String(credentials));
@@ -167,16 +167,16 @@ Add the `ClientAuthMiddleware.cs` class under the *App_Start* folder. To do so:
167167
{
168168
return false;
169169
}
170-
170+
171171
var ix = pair.IndexOf(':');
172172
if (ix == -1)
173173
{
174174
return false;
175175
}
176-
176+
177177
clientId = pair.Substring(0, ix);
178178
clientSecret = pair.Substring(ix + 1);
179-
179+
180180
// Return whether credentials are valid
181181
return (string.Compare(clientId, ClientAuthMiddleware.ClientID) == 0 &&
182182
string.Compare(clientSecret, ClientAuthMiddleware.ClientSecret) == 0);
@@ -190,14 +190,14 @@ Add the `ClientAuthMiddleware.cs` class under the *App_Start* folder. To do so:
190190
Add an OWIN startup class named `Startup.cs` to the API. To do so:
191191
1. Right-click the project, select **Add** > **New Item**, and then search for **OWIN**.
192192

193-
![Add an OWIN startup class](media/aadb2c-ief-rest-api-netfw-secure-basic/rest-api-netfw-secure-basic-OWIN-startup.png)
193+
![Creating OWIN startup class in Add New Item dialog in Visual Studio](media/aadb2c-ief-rest-api-netfw-secure-basic/rest-api-netfw-secure-basic-OWIN-startup.png)
194194

195195
2. Open the *Startup.cs* file, and replace the file content with following code:
196196

197197
```csharp
198198
using Microsoft.Owin;
199199
using Owin;
200-
200+
201201
[assembly: OwinStartup(typeof(Contoso.AADB2C.API.Startup))]
202202
namespace Contoso.AADB2C.API
203203
{
@@ -236,7 +236,7 @@ After your RESTful service is protected by the client ID (username) and secret,
236236

237237
4. For **Options**, select **Manual**.
238238

239-
5. For **Name**, type **B2cRestClientId**.
239+
5. For **Name**, type **B2cRestClientId**.
240240
The prefix *B2C_1A_* might be added automatically.
241241

242242
6. In the **Secret** box, enter the app ID that you defined earlier.
@@ -257,7 +257,7 @@ After your RESTful service is protected by the client ID (username) and secret,
257257

258258
4. For **Options**, select **Manual**.
259259

260-
5. For **Name**, type **B2cRestClientSecret**.
260+
5. For **Name**, type **B2cRestClientSecret**.
261261
The prefix *B2C_1A_* might be added automatically.
262262

263263
6. In the **Secret** box, enter the app secret that you defined earlier.
@@ -292,8 +292,8 @@ After your RESTful service is protected by the client ID (username) and secret,
292292
```
293293

294294
After you add the snippet, your technical profile should look like the following XML code:
295-
296-
![Add basic authentication XML elements](media/aadb2c-ief-rest-api-netfw-secure-basic/rest-api-netfw-secure-basic-add-1.png)
295+
296+
![Add basic authentication XML elements to TechnicalProfile](media/aadb2c-ief-rest-api-netfw-secure-basic/rest-api-netfw-secure-basic-add-1.png)
297297

298298
## Step 5: Upload the policy to your tenant
299299

@@ -318,12 +318,12 @@ After your RESTful service is protected by the client ID (username) and secret,
318318

319319
2. Open **B2C_1A_signup_signin**, the relying party (RP) custom policy that you uploaded, and then select **Run now**.
320320

321-
3. Test the process by typing **Test** in the **Given Name** box.
321+
3. Test the process by typing **Test** in the **Given Name** box.
322322
Azure AD B2C displays an error message at the top of the window.
323323

324-
![Test your identity API](media/aadb2c-ief-rest-api-netfw-secure-basic/rest-api-netfw-test.png)
324+
![Testing the Given Name input validation in your identity API](media/aadb2c-ief-rest-api-netfw-secure-basic/rest-api-netfw-test.png)
325325

326-
4. In the **Given Name** box, type a name (other than "Test").
326+
4. In the **Given Name** box, type a name (other than "Test").
327327
Azure AD B2C signs up the user and then sends a loyalty number to your application. Note the number in this example:
328328

329329
```

articles/active-directory-b2c/active-directory-b2c-custom-rest-api-netfw-secure-cert.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,24 @@ To set up **Azure App Service** to require client certificates, set the web app
4343
>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).
4444
4545
## 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:
4747
1. In your Azure AD B2C tenant, select **B2C Settings** > **Identity Experience Framework**.
4848

4949
2. To view the keys that are available in your tenant, select **Policy Keys**.
5050

51-
3. Select **Add**.
51+
3. Select **Add**.
5252
The **Create a key** window opens.
5353

5454
4. In the **Options** box, select **Upload**.
5555

56-
5. In the **Name** box, type **B2cRestClientCertificate**.
56+
5. In the **Name** box, type **B2cRestClientCertificate**.
5757
The prefix *B2C_1A_* is added automatically.
5858

5959
6. In the **File upload** box, select your certificate's .pfx file with a private key.
6060

6161
7. In the **Password** box, type the certificate's password.
6262

63-
![Upload policy key](media/aadb2c-ief-rest-api-netfw-secure-cert/rest-api-netfw-secure-client-cert-upload.png)
63+
![Upload policy key in the Create a key page in Azure portal](media/aadb2c-ief-rest-api-netfw-secure-cert/rest-api-netfw-secure-client-cert-upload.png)
6464

6565
7. Select **Create**.
6666

@@ -81,7 +81,7 @@ To support client certificate authentication in your custom policy, change the t
8181
<Item Key="AuthenticationType">ClientCertificate</Item>
8282
```
8383

84-
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:
8585

8686
```xml
8787
<CryptographicKeys>
@@ -115,12 +115,12 @@ To support client certificate authentication in your custom policy, change the t
115115

116116
2. Open **B2C_1A_signup_signin**, the relying party (RP) custom policy that you uploaded, and then select **Run now**.
117117

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.
120120

121-
![Test your identity API](media/aadb2c-ief-rest-api-netfw-secure-basic/rest-api-netfw-test.png)
121+
![Given Name text box highlighted and input validation error shown](media/aadb2c-ief-rest-api-netfw-secure-basic/rest-api-netfw-test.png)
122122

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").
124124
Azure AD B2C signs up the user and then sends a loyalty number to your application. Note the number in this JWT example:
125125

126126
```
@@ -148,7 +148,7 @@ To support client certificate authentication in your custom policy, change the t
148148
>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.
149149
150150
## 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.
152152
153153
In this section, you add sample ASP.NET code that validates the certificate properties for authentication purposes.
154154
@@ -167,7 +167,7 @@ In the Visual Studio project that you created earlier, add the following applica
167167
Replace the certificate's **Subject name**, **Issuer name**, and **Certificate thumbprint** values with your certificate values.
168168

169169
### 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:
171171

172172
```csharp
173173
private bool IsValidClientCertificate()
@@ -215,7 +215,7 @@ private bool IsValidClientCertificate()
215215
Trace.TraceError($"Subject name '{clientCertInRequest.Subject}' is not valid");
216216
return false;
217217
}
218-
218+
219219
// 3. Check the issuer name of the certificate
220220
bool foundIssuerCN = false;
221221
string[] certIssuerData = clientCertInRequest.Issuer.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
@@ -269,7 +269,7 @@ In the preceding sample code, we accept the certificate as valid only if all the
269269
>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.
270270
271271
### 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:
273273

274274
```csharp
275275
if (IsValidClientCertificate() == false)
@@ -295,4 +295,4 @@ If you need to troubleshoot this step, see [Collecting logs by using Application
295295

296296
## (Optional) Download the complete policy files and code
297297
* 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

Comments
 (0)