Skip to content

Commit 1e8fb8f

Browse files
Merge pull request #277550 from kengaderdus/pr-121333
additional details for defining the error code and error message via …
2 parents d357a73 + 323455c commit 1e8fb8f

File tree

1 file changed

+52
-1
lines changed

1 file changed

+52
-1
lines changed

articles/active-directory-b2c/oauth2-error-technical-profile.md

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: CelesteDG
99
ms.service: active-directory
1010

1111
ms.topic: reference
12-
ms.date: 01/11/2024
12+
ms.date: 05/07/2024
1313
ms.author: kengaderdus
1414
ms.subservice: B2C
1515

@@ -73,6 +73,43 @@ The following example shows a technical profile for `ReturnOAuth2Error`:
7373
</ClaimsProviders> -->
7474
```
7575

76+
## Define claims transformation to generate custom values of error code and error message
77+
78+
Use these steps to generate custom values of error code and error message:
79+
80+
1. Locate the `ClaimsTransformations` element, then add the following code inside it
81+
82+
```xml
83+
<!--
84+
<ClaimsTransformations> -->
85+
<ClaimsTransformation Id="GenerateErrorCode" TransformationMethod="CreateStringClaim">
86+
<InputParameters>
87+
<InputParameter Id="value" DataType="string" Value="Error_001" />
88+
</InputParameters>
89+
<OutputClaims>
90+
<OutputClaim ClaimTypeReferenceId="errorCode" TransformationClaimType="createdClaim" />
91+
</OutputClaims>
92+
</ClaimsTransformation>
93+
<ClaimsTransformation Id="GenerateErrorMessage" TransformationMethod="CreateStringClaim">
94+
<InputParameters>
95+
<InputParameter Id="value" DataType="string" Value="Insert error description." />
96+
</InputParameters>
97+
<OutputClaims>
98+
<OutputClaim ClaimTypeReferenceId="errorMessage" TransformationClaimType="createdClaim" />
99+
</OutputClaims>
100+
</ClaimsTransformation>
101+
<!--
102+
</ClaimsTransformations> -->
103+
```
104+
105+
1. Add the two claims transformations in the `OutputClaimsTransformations` element of any technical profile before Oauth2 technical that you define:
106+
107+
```xml
108+
<OutputClaimsTransformations>
109+
<OutputClaimsTransformation ReferenceId="generateErrorCode" />
110+
<OutputClaimsTransformation ReferenceId="generateErrorMessage" />
111+
</OutputClaimsTransformations>
112+
```
76113
## Input claims
77114

78115
The **InputClaims** element contains a list of claims required to return OAuth2 error.
@@ -123,6 +160,20 @@ In the following example:
123160
</UserJourney>
124161
```
125162

163+
Optionally, you can use preconditions to manipulate the Oauth2 error technical profile. For example, if there is no email claim, you can set to call Oauth2 error technical profile:
164+
165+
```xml
166+
<OrchestrationStep Order="3" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="ReturnOAuth2Error">
167+
<Preconditions>
168+
<Precondition Type="ClaimsExist" ExecuteActionsIf="false">
169+
<Value>email</Value>
170+
<Action>SkipThisOrchestrationStep</Action>
171+
</Precondition>
172+
</Preconditions>
173+
</OrchestrationStep>
174+
```
175+
176+
126177
## Next steps
127178

128179
Learn about [UserJourneys](userjourneys.md)

0 commit comments

Comments
 (0)