-
Notifications
You must be signed in to change notification settings - Fork 0
/
TrustFrameworkExtensionsGW.xml
309 lines (279 loc) · 15.6 KB
/
TrustFrameworkExtensionsGW.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
<?xml ver{your_organization}on="1.0" encoding="utf-8" ?>
<TrustFrameworkPolicy
xmlns:x{your_organization}="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"
PolicySchemaVer{your_organization}on="0.3.0.0"
TenantId="{your_tenant_name}"
PolicyId="B2C_1A_TrustFrameworkExten{your_organization}onsGW"
PublicPolicyUri="http://{your_tenant_name}/B2C_1A_TrustFrameworkExten{your_organization}ons">
<BasePolicy>
<TenantId>{your_tenant_name}</TenantId>
<PolicyId>B2C_1A_TrustFrameworkBase</PolicyId>
</BasePolicy>
<BuildingBlocks>
<ClaimsSchema>
<!-- For Application In{your_organization}ghts logging -->
<ClaimType Id="EventType">
<DisplayName>Event type</DisplayName>
<DataType>string</DataType>
</ClaimType>
<ClaimType Id="EventTimestamp">
<DisplayName>Event timestamp</DisplayName>
<DataType>string</DataType>
</ClaimType>
<ClaimType Id="PolicyId">
<DisplayName>Policy Id</DisplayName>
<DataType>string</DataType>
</ClaimType>
<ClaimType Id="Culture">
<DisplayName>Culture ID</DisplayName>
<DataType>string</DataType>
</ClaimType>
<ClaimType Id="CorrelationId">
<DisplayName>Correlation Id</DisplayName>
<DataType>string</DataType>
</ClaimType>
<ClaimType Id="federatedUser">
<DisplayName>Federated user</DisplayName>
<DataType>boolean</DataType>
</ClaimType>
<ClaimType Id="parsedDomain">
<DisplayName>Domain name</DisplayName>
<DataType>string</DataType>
<UserHelpText>The domain portion of the email address.</UserHelpText>
</ClaimType>
<ClaimType Id="appId2">
<DisplayName>Application ID</DisplayName>
<DataType>string</DataType>
<UserHelpText>The B2C app ID??.</UserHelpText>
</ClaimType>
<ClaimType Id="client_IP">
<DisplayName>User IP Address</DisplayName>
<DataType>string</DataType>
<UserHelpText>The IP.</UserHelpText>
</ClaimType>
</ClaimsSchema>
</BuildingBlocks>
<ClaimsProviders>
<!-- These are the "inbound" OIDC providers we trust to send claims into our authentication User Journey -->
<ClaimsProvider>
<Domain>okta.com-SAML</Domain>
<DisplayName>Okta-SAML</DisplayName>
<TechnicalProfiles>
<TechnicalProfile Id="Okta-SAML2-GW">
<DisplayName>Okta via SAML</DisplayName>
<Description>Login with your Okta account</Description>
<Protocol Name="SAML2"/>
<Metadata>
<Item Key="WantsEncryptedAssertions">false</Item>
<Item Key="WantssignedAssertions">false</Item>
<Item Key="PartnerEntity">https://{xyz}.okta.com/app/exkqfxet4nKDWlgMj0x7/sso/saml/metadata</Item>
</Metadata>
<CryptographicKeys>
<Key Id="SamlMessagesigning" StorageReferenceId="B2C_1A_SamlIdpCert"/>
</CryptographicKeys>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="issuerUserId" PartnerClaimType="userPrincipalName" />
<OutputClaim ClaimTypeReferenceId="userPrincipalName" PartnerClaimType="userPrincipalName" />
<OutputClaim ClaimTypeReferenceId="givenName" PartnerClaimType="givenName"/>
<OutputClaim ClaimTypeReferenceId="surname" PartnerClaimType="surname"/>
<OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="email"/>
<OutputClaim ClaimTypeReferenceId="displayName" PartnerClaimType="name"/>
</OutputClaims>
<UseTechnicalProfileForSessionManagement ReferenceId="SM-Saml-idp"/>
</TechnicalProfile>
</TechnicalProfiles>
</ClaimsProvider>
<ClaimsProvider>
<!-- domain_hint -->
<Domain>okta.com-OIDC</Domain>
<DisplayName>Okta-OIDC</DisplayName>
<TechnicalProfiles>
<TechnicalProfile Id="Okta-OIDC-GW">
<!-- user-visible name in login screen -->
<DisplayName>Employees</DisplayName>
<Protocol Name="OpenIdConnect" />
<Metadata>
<Item Key="METADATA">https://{xyz}.okta.com/.well-known/openid-configuration</Item>
<Item Key="response_types">code</Item>
<Item Key="response_mode">form_post</Item>
<Item Key="scope">openid email okta.users.read.self</Item>
<Item Key="HttpBinding">POST</Item>
<Item Key="UsePolicyInRedirectUri">0</Item>
<Item Key="client_id">9999999</Item>
<Item Key="MarkAsFailureOnStatusCode5xx">true</Item> <!-- HCK experimenting with missing claims-->
</Metadata>
<CryptographicKeys>
<Key Id="client_secret" StorageReferenceId="B2C_1A_okta" />
</CryptographicKeys>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="identityProvider" DefaultValue="{xyz}.okta.com" />
<OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="socialIdpAuthentication" />
<OutputClaim ClaimTypeReferenceId="issuerUserId" PartnerClaimType="sub" />
<OutputClaim ClaimTypeReferenceId="displayName" PartnerClaimType="name" />
<OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="email" DefaultValue="default value from input ClaimsProvider: email"/>
<OutputClaim ClaimTypeReferenceId="givenName" PartnerClaimType="given_name" DefaultValue="default value from input ClaimsProvider: givenName"/>
<OutputClaim ClaimTypeReferenceId="surname" PartnerClaimType="family_name" DefaultValue="default value from input ClaimsProvider: surname"/>
<OutputClaim ClaimTypeReferenceId="userPrincipalName" PartnerClaimType="preferred_username" DefaultValue="unknown from Okta CP" /> <!-- HCK figure out how to use UserId-->
</OutputClaims>
<UseTechnicalProfileForSessionManagement ReferenceId="SM-SocialLogin" />
</TechnicalProfile>
</TechnicalProfiles>
</ClaimsProvider>
<ClaimsProvider>
<Domain>commonaad</Domain>
<DisplayName>Common AAD</DisplayName>
<TechnicalProfiles>
<TechnicalProfile Id="Common-AAD-GW">
<!--
<DisplayName>Your Organization's Azure Active Directory</DisplayName>
--> <DisplayName>Customers and Partners</DisplayName>
<Description>Login with your existing Azure AD account</Description>
<Protocol Name="OpenIdConnect"/>
<Metadata>
<Item Key="METADATA">https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration</Item>
<!-- Update the Client ID below to the Application ID -->
<Item Key="client_id">{your_client_id}</Item>
<Item Key="response_types">code</Item>
<Item Key="scope">openid profile</Item>
<Item Key="response_mode">form_post</Item>
<Item Key="HttpBinding">POST</Item>
<Item Key="UsePolicyInRedirectUri">false</Item>
<Item Key="DiscoverMetadataByTokenIssuer">true</Item>
<!-- The key below allows you to specify each of the Azure AD tenants that can be used to sign in. Update the GUIDs below for each tenant. -->
<!--
<Item Key="ValidTokenIssuerPrefixes">https://login.microsoftonline.com/4a809fb2-0c7f-4201-95da-99999999999999</Item>
-->
<!-- The commented key below specifies that users from any tenant can sign-in. Uncomment if you would like anyone with an Azure AD account to be able to sign in. -->
<!-- -->
<Item Key="ValidTokenIssuerPrefixes">https://login.microsoftonline.com/</Item>
</Metadata>
<CryptographicKeys>
<Key Id="client_secret" StorageReferenceId="B2C_1A_AADAppSecret"/>
</CryptographicKeys>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="issuerUserId" PartnerClaimType="oid"/>
<OutputClaim ClaimTypeReferenceId="tenantId" PartnerClaimType="tid"/>
<OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="email" DefaultValue="default value from input ClaimsProvider: email"/>
<OutputClaim ClaimTypeReferenceId="givenName" PartnerClaimType="given_name" DefaultValue="default value from input ClaimsProvider: givenName"/>
<OutputClaim ClaimTypeReferenceId="surname" PartnerClaimType="family_name" DefaultValue="default value from input ClaimsProvider: surname"/>
<OutputClaim ClaimTypeReferenceId="userPrincipalName" PartnerClaimType="picture" DefaultValue="upn default from CP"/>
<OutputClaim ClaimTypeReferenceId="displayName" PartnerClaimType="name" />
<OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="socialIdpAuthentication" AlwaysUseDefaultValue="true" />
<OutputClaim ClaimTypeReferenceId="identityProvider" PartnerClaimType="iss" />
</OutputClaims>
<UseTechnicalProfileForSessionManagement ReferenceId="SM-SocialLogin"/>
</TechnicalProfile>
</TechnicalProfiles>
</ClaimsProvider>
<!-- "Outbound" providers sending claims to relying app -->
<ClaimsProvider>
<DisplayName>Token Issuer</DisplayName>
<TechnicalProfiles>
<!-- SAML Token Issuer technical profile -->
<TechnicalProfile Id="Saml2AssertionIssuer">
<DisplayName>Token Issuer</DisplayName>
<Protocol Name="SAML2"/>
<OutputTokenFormat>SAML2</OutputTokenFormat>
<Metadata>
<!-- The issuer contains the policy name; it should be the same name as configured in the relying party application. B2C_1A_signup_signin_SAML is used below. -->
<Item Key="IssuerUri">https://{short_name}.b2clogin.com/{your_tenant_name}/B2C_1A_fedgwsignin_SAML</Item>
</Metadata>
<CryptographicKeys>
<Key Id="Metadatasigning" StorageReferenceId="B2C_1A_SamlIdpCert"/>
<Key Id="SamlAssertionsigning" StorageReferenceId="B2C_1A_SamlIdpCert"/>
<Key Id="SamlMessagesigning" StorageReferenceId="B2C_1A_SamlIdpCert"/>
</CryptographicKeys>
<InputClaims/>
<UseTechnicalProfileForSessionManagement ReferenceId="SM-Saml-issuer"/>
</TechnicalProfile>
<!-- Session management technical profile for SAML based tokens -->
<TechnicalProfile Id="SM-Saml-issuer">
<DisplayName>Session Management Provider</DisplayName>
<Protocol Name="Proprietary" Handler="Web.TPEngine.SSO.SamlSSOSessionProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
</TechnicalProfile>
</TechnicalProfiles>
</ClaimsProvider>
<ClaimsProvider>
<DisplayName>Session Management</DisplayName>
<TechnicalProfiles>
<TechnicalProfile Id="SM-Saml-idp">
<DisplayName>Session Management Provider</DisplayName>
<Protocol Name="Proprietary" Handler="Web.TPEngine.SSO.SamlSSOSessionProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Metadata>
<Item Key="IncludeSessionIndex">false</Item>
<Item Key="RegisterServiceProviders">false</Item>
</Metadata>
</TechnicalProfile>
</TechnicalProfiles>
</ClaimsProvider>
<!-- Logging provider -->
<ClaimsProvider>
<DisplayName>Application Insights</DisplayName>
<TechnicalProfiles>
<TechnicalProfile Id="AppInsights-Common">
<DisplayName>Application Insights</DisplayName>
<Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.Insights.AzureApplicationInsightsProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Metadata>
<!-- The ApplicationInsights instrumentation key which will be used for logging the events -->
<Item Key="InstrumentationKey">{your_instrumentation_key}</Item>
<Item Key="DeveloperMode">true</Item> <!-- faster processing of security logs -->
<Item Key="DisableTelemetry ">false</Item>
</Metadata>
<InputClaims>
<!-- Properties of an event are added through the syntax {property:NAME}, where NAME is property being added to the event. DefaultValue can be either a static value or a value that's resolved by one of the supported DefaultClaimResolvers. -->
<InputClaim ClaimTypeReferenceId="EventTimestamp" PartnerClaimType="{property:EventTimestamp}" DefaultValue="{Context:DateTimeInUtc}" />
<InputClaim ClaimTypeReferenceId="PolicyId" PartnerClaimType="{property:Policy}" DefaultValue="{Policy:PolicyId}" />
<InputClaim ClaimTypeReferenceId="CorrelationId" PartnerClaimType="{property:CorrelationId}" DefaultValue="{Context:CorrelationId}" />
<!-- <InputClaim ClaimTypeReferenceId="Culture" DefaultValue="{Culture:RFC5646}" />
PartnerClaimType="{property:Culture}"
-->
</InputClaims>
</TechnicalProfile>
<TechnicalProfile Id="AppInsights-SignInComplete">
<InputClaims>
<InputClaim ClaimTypeReferenceId="EventType" DefaultValue="SignInComplete" />
<InputClaim ClaimTypeReferenceId="userPrincipalName" DefaultValue="{Claim:userPrincipalName}" />
<InputClaim ClaimTypeReferenceId="client_IP" DefaultValue="{Context:IPAddress}" />
</InputClaims>
<IncludeTechnicalProfile ReferenceId="AppInsights-Common" />
</TechnicalProfile>
<!--
<InputClaim ClaimTypeReferenceId="AppId2" DefaultValue="{OIDC:ClientId}" />
<InputClaim ClaimTypeReferenceId="federatedUser" PartnerClaimType="{property:FederatedUser}" DefaultValue="false" />
<InputClaim ClaimTypeReferenceId="parsedDomain" PartnerClaimType="{property:FederationPartner}" DefaultValue="Not Applicable" />
-->
</TechnicalProfiles>
</ClaimsProvider>
</ClaimsProviders>
<UserJourneys>
<UserJourney Id="SignInFederationGW">
<OrchestrationSteps>
<OrchestrationStep Order="1" Type="ClaimsProviderSelection" ContentDefinitionReferenceId="api.idpselections">
<ClaimsProviderSelections>
<!-- Buttons/fields to display to user. Clicking one of these will invoke one of the ClaimsExchange items in the next step -->
<ClaimsProviderSelection TargetClaimsExchangeId="Okta-OIDC-ClaimsExchange" />
<ClaimsProviderSelection TargetClaimsExchangeId="Okta-SAML-ClaimsExchange" />
<ClaimsProviderSelection TargetClaimsExchangeId="AzureAD-OIDC-ClaimsExchange" />
</ClaimsProviderSelections>
</OrchestrationStep>
<!-- Perform the claims exchange (from the user's home IDP-provided claims into Azure claims) with the user's chosen IDP -->
<OrchestrationStep Order="2" Type="ClaimsExchange">
<ClaimsExchanges>
<ClaimsExchange Id="Okta-OIDC-ClaimsExchange" TechnicalProfileReferenceId="Okta-OIDC-GW" />
<ClaimsExchange Id="Okta-SAML-ClaimsExchange" TechnicalProfileReferenceId="Okta-SAML2-GW" />
<ClaimsExchange Id="AzureAD-OIDC-ClaimsExchange" TechnicalProfileReferenceId="Common-AAD-GW" />
</ClaimsExchanges>
</OrchestrationStep>
<OrchestrationStep Order="3" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="JwtIssuer" />
<OrchestrationStep Order="4" Type="ClaimsExchange">
<ClaimsExchanges>
<ClaimsExchange Id="TrackSignInComplete" TechnicalProfileReferenceId="AppInsights-SignInComplete" />
</ClaimsExchanges>
</OrchestrationStep>
</OrchestrationSteps>
<ClientDefinition ReferenceId="DefaultWeb" />
</UserJourney>
</UserJourneys>
</TrustFrameworkPolicy>