-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathCT_AddItemToAlternativeSecurityIdCollection.xml
161 lines (151 loc) · 7.68 KB
/
CT_AddItemToAlternativeSecurityIdCollection.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TrustFrameworkPolicy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06" PolicySchemaVersion="0.3.0.0"
TenantId="yourtenant.onmicrosoft.com"
PolicyId="B2C_1A_CT_AddItemToAlternativeSecurityIdCollection"
PublicPolicyUri="http://yourtenant.onmicrosoft.com/B2C_1A_CT_AddItemToAlternativeSecurityIdCollection">
<BasePolicy>
<TenantId>yourtenant.onmicrosoft.com</TenantId>
<PolicyId>B2C_1A_TrustFrameworkExtensions</PolicyId>
</BasePolicy>
<BuildingBlocks>
<ClaimsSchema>
<ClaimType Id="issuerUserId1">
<DisplayName>Issuer user Id 1</DisplayName>
<DataType>string</DataType>
<UserInputType>TextBox</UserInputType>
</ClaimType>
<ClaimType Id="issuerUserId2">
<DisplayName>Issuer user Id 2</DisplayName>
<DataType>string</DataType>
<UserInputType>TextBox</UserInputType>
</ClaimType>
<ClaimType Id="identityProvider1">
<DisplayName>Identity provider 1</DisplayName>
<DataType>string</DataType>
<UserInputType>TextBox</UserInputType>
</ClaimType>
<ClaimType Id="identityProvider2">
<DisplayName>Identity provider 2</DisplayName>
<DataType>string</DataType>
<UserInputType>TextBox</UserInputType>
</ClaimType>
<ClaimType Id="alternativeSecurityId1">
<DisplayName>alternativeSecurityId1</DisplayName>
<DataType>string</DataType>
</ClaimType>
<ClaimType Id="alternativeSecurityId2">
<DisplayName>alternativeSecurityId2</DisplayName>
<DataType>string</DataType>
</ClaimType>
<ClaimType Id="result">
<DisplayName>The result of this claims transformation (result)</DisplayName>
<DataType>alternativeSecurityIdCollection</DataType>
<UserInputType>Readonly</UserInputType>
</ClaimType>
</ClaimsSchema>
<ClaimsTransformations>
<ClaimsTransformation Id="CreateFirstAlternativeSecurityId" TransformationMethod="CreateAlternativeSecurityId">
<InputClaims>
<InputClaim ClaimTypeReferenceId="issuerUserId1" TransformationClaimType="key" />
<InputClaim ClaimTypeReferenceId="identityProvider1" TransformationClaimType="identityProvider" />
</InputClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="alternativeSecurityId1" TransformationClaimType="alternativeSecurityId" />
</OutputClaims>
</ClaimsTransformation>
<ClaimsTransformation Id="CreateSecondAlternativeSecurityId" TransformationMethod="CreateAlternativeSecurityId">
<InputClaims>
<InputClaim ClaimTypeReferenceId="issuerUserId2" TransformationClaimType="key" />
<InputClaim ClaimTypeReferenceId="identityProvider2" TransformationClaimType="identityProvider" />
</InputClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="alternativeSecurityId2" TransformationClaimType="alternativeSecurityId" />
</OutputClaims>
</ClaimsTransformation>
<ClaimsTransformation Id="AddFirstAlternativeSecurityId" TransformationMethod="AddItemToAlternativeSecurityIdCollection">
<InputClaims>
<InputClaim ClaimTypeReferenceId="alternativeSecurityId1" TransformationClaimType="item" />
<InputClaim ClaimTypeReferenceId="result" TransformationClaimType="collection" />
</InputClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="result" TransformationClaimType="collection" />
</OutputClaims>
</ClaimsTransformation>
<ClaimsTransformation Id="AddSecondAlternativeSecurityId" TransformationMethod="AddItemToAlternativeSecurityIdCollection">
<InputClaims>
<InputClaim ClaimTypeReferenceId="alternativeSecurityId2" TransformationClaimType="item" />
<InputClaim ClaimTypeReferenceId="result" TransformationClaimType="collection" />
</InputClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="result" TransformationClaimType="collection" />
</OutputClaims>
</ClaimsTransformation>
</ClaimsTransformations>
</BuildingBlocks>
<ClaimsProviders>
<ClaimsProvider>
<DisplayName>Unit tests</DisplayName>
<TechnicalProfiles>
<!--Experimental technical profile (first page)-->
<TechnicalProfile Id="ExperimentalTechnicalProfile">
<DisplayName>Unit test</DisplayName>
<Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Metadata>
<Item Key="ContentDefinitionReferenceId">api.selfasserted</Item>
</Metadata>
<InputClaims>
<InputClaim ClaimTypeReferenceId="issuerUserId1" DefaultValue="12345" />
<InputClaim ClaimTypeReferenceId="identityProvider1" DefaultValue="contoso.com" />
<InputClaim ClaimTypeReferenceId="issuerUserId2" DefaultValue="abcde" />
<InputClaim ClaimTypeReferenceId="identityProvider2" DefaultValue="live.com" />
</InputClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="issuerUserId1" Required="true" />
<OutputClaim ClaimTypeReferenceId="identityProvider1" Required="true" />
<OutputClaim ClaimTypeReferenceId="issuerUserId2" Required="true" />
<OutputClaim ClaimTypeReferenceId="identityProvider2" Required="true" />
</OutputClaims>
<OutputClaimsTransformations>
<OutputClaimsTransformation ReferenceId="CreateFirstAlternativeSecurityId" />
<OutputClaimsTransformation ReferenceId="CreateSecondAlternativeSecurityId" />
<OutputClaimsTransformation ReferenceId="AddFirstAlternativeSecurityId" />
<OutputClaimsTransformation ReferenceId="AddSecondAlternativeSecurityId" />
</OutputClaimsTransformations>
<UseTechnicalProfileForSessionManagement ReferenceId="SM-Noop" />
</TechnicalProfile>
</TechnicalProfiles>
</ClaimsProvider>
</ClaimsProviders>
<UserJourneys>
<UserJourney Id="UnitTestJourney">
<OrchestrationSteps>
<OrchestrationStep Order="1" Type="ClaimsExchange">
<ClaimsExchanges>
<ClaimsExchange Id="ExperimentalTechnicalProfile" TechnicalProfileReferenceId="ExperimentalTechnicalProfile" />
</ClaimsExchanges>
</OrchestrationStep>
<OrchestrationStep Order="2" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="JwtIssuer" />
</OrchestrationSteps>
</UserJourney>
</UserJourneys>
<RelyingParty>
<DefaultUserJourney ReferenceId="UnitTestJourney" />
<TechnicalProfile Id="PolicyProfile">
<DisplayName>PolicyProfile</DisplayName>
<Protocol Name="OpenIdConnect" />
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="sub" DefaultValue="1234" />
<OutputClaim ClaimTypeReferenceId="tenantId" AlwaysUseDefaultValue="true" DefaultValue="{Policy:TenantObjectId}" />
<!-- Unit test claims-->
<OutputClaim ClaimTypeReferenceId="issuerUserId1" />
<OutputClaim ClaimTypeReferenceId="identityProvider1" />
<OutputClaim ClaimTypeReferenceId="issuerUserId2" />
<OutputClaim ClaimTypeReferenceId="identityProvider2" />
<OutputClaim ClaimTypeReferenceId="alternativeSecurityId1" />
<OutputClaim ClaimTypeReferenceId="alternativeSecurityId2" />
<OutputClaim ClaimTypeReferenceId="result" />
</OutputClaims>
<SubjectNamingInfo ClaimType="sub" />
</TechnicalProfile>
</RelyingParty>
</TrustFrameworkPolicy>