Skip to content

Commit ecb1a46

Browse files
authored
Update add-captcha.md
Adds feature flags to secure CAPTCHA
1 parent caea2ea commit ecb1a46

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

articles/active-directory-b2c/add-captcha.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,21 @@ You need more claims to enable CAPTCHA in your custom policy:
118118
<DisplayName>Flag indicating that the captcha was successfully solved</DisplayName>
119119
<DataType>boolean</DataType>
120120
</ClaimType>
121+
122+
<ClaimType Id="mfaCaptchaEnabled">
123+
<DisplayName>flag used to control captcha enabled in MFA</DisplayName>
124+
<DataType>string</DataType>
125+
</ClaimType>
126+
127+
<ClaimType Id="signupCaptchaEnabled">
128+
<DisplayName>flag used to control captcha enabled during signup</DisplayName>
129+
<DataType>string</DataType>
130+
</ClaimType>
131+
132+
<ClaimType Id="signinCaptchaEnabled">
133+
<DisplayName>flag used to control captcha enabled during signin</DisplayName>
134+
<DataType>string</DataType>
135+
</ClaimType>
121136
...
122137
<!--<ClaimsSchema>-->
123138
```
@@ -314,6 +329,57 @@ To enable CAPTCHA in MFA flow, you need to make an update in two technical profi
314329
...
315330
</TechnicalProfile>
316331
```
332+
333+
### Enable CAPTCHA feature flag
334+
335+
1. In the *TrustFrameworkBase.XML* file, locate the `ClaimsProviders` element and add the claims provider by using the following code:
336+
337+
```xml
338+
<!--<ClaimsProvider>-->
339+
...
340+
<ClaimsProvider>
341+
342+
<DisplayName>Set Feature Flags</DisplayName>
343+
344+
<TechnicalProfiles>
345+
346+
<TechnicalProfile Id="SetFeatureDefaultValue">
347+
<DisplayName>Set Feature Flags</DisplayName>
348+
<Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.ClaimsTransformationProtocolProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
349+
<OutputClaims>
350+
<OutputClaim ClaimTypeReferenceId="signupCaptchaEnabled" DefaultValue="true" />
351+
<OutputClaim ClaimTypeReferenceId="signinCaptchaEnabled" DefaultValue="true" />
352+
<OutputClaim ClaimTypeReferenceId="mfaCaptchaEnabled" DefaultValue="true" />
353+
</OutputClaims>
354+
</TechnicalProfile>
355+
</TechnicalProfiles>
356+
</ClaimsProvider>
357+
...
358+
<!--<ClaimsProviders>-->
359+
```
360+
361+
2. Set `DefaultValue` to true or false depending on the CAPTCHA scenario
362+
363+
3. Add the feature flags technical profile to the user journey
364+
365+
```xml
366+
<!--<UserJourneys>-->
367+
...
368+
<UserJourney Id="SignUpOrSignIn">
369+
<OrchestrationSteps>
370+
371+
<!--Add this orchestration step-->
372+
<OrchestrationStep Order="1" Type="ClaimsExchange">
373+
<ClaimsExchanges>
374+
<ClaimsExchange Id="SetFeatureDefaultValue" TechnicalProfileReferenceId="SetFeatureDefaultValue" />
375+
</ClaimsExchanges>
376+
</OrchestrationStep>
377+
...
378+
<!--<UserJourneys>-->
379+
```
380+
381+
4. Reorder the rest of the orchestration steps in chronological order
382+
317383
## Upload the custom policy files
318384

319385
Use the steps in [Upload the policies](tutorial-create-user-flows.md?pivots=b2c-custom-policy&branch=pr-en-us-260336#upload-the-policies) to upload your custom policy files.

0 commit comments

Comments
 (0)