Skip to content

Commit 1dbad2b

Browse files
authored
Merge pull request #134048 from yoelhor/patch-38
Update configure-tokens-custom-policy.md
2 parents 070f455 + add532a commit 1dbad2b

File tree

2 files changed

+52
-2
lines changed

2 files changed

+52
-2
lines changed

articles/active-directory-b2c/configure-tokens-custom-policy.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: celestedg
99
ms.service: active-directory
1010
ms.workload: identity
1111
ms.topic: how-to
12-
ms.date: 05/07/2020
12+
ms.date: 10/21/2020
1313
ms.author: mimart
1414
ms.subservice: B2C
1515
---
@@ -87,6 +87,45 @@ The following values are set in the previous example:
8787
> [!NOTE]
8888
> Single-page applications using the authorization code flow with PKCE always have a refresh token lifetime of 24 hours. [Learn more about the security implications of refresh tokens in the browser](../active-directory/develop/reference-third-party-cookies-spas.md#security-implications-of-refresh-tokens-in-the-browser).
8989

90+
## Provide optional claims to your app
91+
92+
The [Relying party policy technical profile](relyingparty.md#technicalprofile) output claims are values that are returned to an application. Adding output claims will issue the claims into the token after a successful user journey, and will be sent to the application. Modify the technical profile element within the relying party section to add the desired claims as an output claim.
93+
94+
1. Open your custom policy file. For example, SignUpOrSignin.xml.
95+
1. Find the OutputClaims element. Add the OutputClaim you want to be included in the token.
96+
1. Set the output claim attributes.
97+
98+
The following example adds the `accountBalance` claim. The accountBalance claim is sent to the application as a balance.
99+
100+
```xml
101+
<RelyingParty>
102+
<DefaultUserJourney ReferenceId="SignUpOrSignIn" />
103+
<TechnicalProfile Id="PolicyProfile">
104+
<DisplayName>PolicyProfile</DisplayName>
105+
<Protocol Name="OpenIdConnect" />
106+
<OutputClaims>
107+
<OutputClaim ClaimTypeReferenceId="displayName" />
108+
<OutputClaim ClaimTypeReferenceId="givenName" />
109+
<OutputClaim ClaimTypeReferenceId="surname" />
110+
<OutputClaim ClaimTypeReferenceId="email" />
111+
<OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="sub"/>
112+
<OutputClaim ClaimTypeReferenceId="identityProvider" />
113+
<OutputClaim ClaimTypeReferenceId="tenantId" AlwaysUseDefaultValue="true" DefaultValue="{Policy:TenantObjectId}" />
114+
<!--Add the optional claims here-->
115+
<OutputClaim ClaimTypeReferenceId="accountBalance" DefaultValue="" PartnerClaimType="balance" />
116+
</OutputClaims>
117+
<SubjectNamingInfo ClaimType="sub" />
118+
</TechnicalProfile>
119+
</RelyingParty>
120+
```
121+
122+
The OutputClaim element contains the following attributes:
123+
124+
- **ClaimTypeReferenceId** - The identifier of a claim type already defined in the [ClaimsSchema](claimsschema.md) section in the policy file or parent policy file.
125+
- **PartnerClaimType** - Allows you to change the name of the claim in the token.
126+
- **DefaultValue** - A default value. You can also set the default value to a [claim resolver](claim-resolver-overview.md), such as tenant ID.
127+
- **AlwaysUseDefaultValue** - Force the use of the default value.
128+
90129
## Next steps
91130

92131
- Learn more about [Azure AD B2C session](session-overview.md).

articles/active-directory-b2c/configure-tokens.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ manager: celestedg
88
ms.service: active-directory
99
ms.workload: identity
1010
ms.topic: how-to
11-
ms.date: 05/07/2020
11+
ms.date: 10/15/2020
1212
ms.author: mimart
1313
ms.subservice: B2C
1414
---
@@ -51,6 +51,17 @@ You can configure the token lifetime on any user flow.
5151

5252
5. Click **Save**.
5353

54+
## Provide optional claims to your app
55+
56+
The application claims are values that are returned to the application. Update your user flow to contain the desired claims.
57+
58+
1. Select **User flows (policies)**.
59+
1. Open the user flow that you previously created.
60+
1. Select **Application claims**.
61+
1. Choose the claims and attributes that you want send back to your application.
62+
1. Click **Save**.
63+
64+
5465
## Next steps
5566

5667
Learn more about how to [request access tokens](access-tokens.md).

0 commit comments

Comments
 (0)