-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
181 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
<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_IDP_Google_SelectAccount" | ||
PublicPolicyUri="http://yourtenant.onmicrosoft.com/B2C_1A_IDP_Google_SelectAccount"> | ||
|
||
<BasePolicy> | ||
<TenantId>yourtenant.onmicrosoft.com</TenantId> | ||
<PolicyId>B2C_1A_TrustFrameworkExtensions</PolicyId> | ||
</BasePolicy> | ||
|
||
<BuildingBlocks> | ||
<ClaimsSchema> | ||
<ClaimType Id="prompt"> | ||
<DataType>string</DataType> | ||
</ClaimType> | ||
</ClaimsSchema> | ||
</BuildingBlocks> | ||
|
||
<ClaimsProviders> | ||
<ClaimsProvider> | ||
<Domain>google.com</Domain> | ||
<DisplayName>Google</DisplayName> | ||
<TechnicalProfiles> | ||
<TechnicalProfile Id="Google-OAuth2"> | ||
<DisplayName>Google</DisplayName> | ||
<Protocol Name="OAuth2" /> | ||
<Metadata> | ||
<Item Key="ProviderName">google</Item> | ||
<Item Key="authorization_endpoint">https://accounts.google.com/o/oauth2/auth</Item> | ||
<Item Key="AccessTokenEndpoint">https://accounts.google.com/o/oauth2/token</Item> | ||
<Item Key="ClaimsEndpoint">https://www.googleapis.com/oauth2/v1/userinfo</Item> | ||
<Item Key="scope">email profile</Item> | ||
<Item Key="HttpBinding">POST</Item> | ||
<Item Key="UsePolicyInRedirectUri">false</Item> | ||
<Item Key="client_id">Your Google application ID</Item> | ||
</Metadata> | ||
<CryptographicKeys> | ||
<Key Id="client_secret" StorageReferenceId="B2C_1A_GoogleSecret" /> | ||
</CryptographicKeys> | ||
<InputClaims> | ||
<InputClaim ClaimTypeReferenceId="prompt" DefaultValue="select_account" AlwaysUseDefaultValue="true" /> | ||
</InputClaims> | ||
<OutputClaims> | ||
<OutputClaim ClaimTypeReferenceId="issuerUserId" PartnerClaimType="id" /> | ||
<OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="email" /> | ||
<OutputClaim ClaimTypeReferenceId="givenName" PartnerClaimType="given_name" /> | ||
<OutputClaim ClaimTypeReferenceId="surname" PartnerClaimType="family_name" /> | ||
<OutputClaim ClaimTypeReferenceId="displayName" PartnerClaimType="name" /> | ||
<OutputClaim ClaimTypeReferenceId="identityProvider" DefaultValue="google.com" /> | ||
<OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="socialIdpAuthentication" /> | ||
</OutputClaims> | ||
<OutputClaimsTransformations> | ||
<OutputClaimsTransformation ReferenceId="CreateRandomUPNUserName" /> | ||
<OutputClaimsTransformation ReferenceId="CreateUserPrincipalName" /> | ||
<OutputClaimsTransformation ReferenceId="CreateAlternativeSecurityId" /> | ||
<OutputClaimsTransformation ReferenceId="CreateSubjectClaimFromAlternativeSecurityId" /> | ||
</OutputClaimsTransformations> | ||
<UseTechnicalProfileForSessionManagement ReferenceId="SM-SocialLogin" /> | ||
</TechnicalProfile> | ||
</TechnicalProfiles> | ||
</ClaimsProvider> | ||
</ClaimsProviders> | ||
<UserJourneys> | ||
<UserJourney Id="SignUpOrSignIn_Custom"> | ||
<OrchestrationSteps> | ||
<OrchestrationStep Order="1" Type="CombinedSignInAndSignUp" ContentDefinitionReferenceId="api.signuporsignin"> | ||
<ClaimsProviderSelections> | ||
<ClaimsProviderSelection TargetClaimsExchangeId="GoogleExchange" /> | ||
<ClaimsProviderSelection ValidationClaimsExchangeId="LocalAccountSigninEmailExchange" /> | ||
</ClaimsProviderSelections> | ||
<ClaimsExchanges> | ||
<ClaimsExchange Id="LocalAccountSigninEmailExchange" TechnicalProfileReferenceId="SelfAsserted-LocalAccountSignin-Email" /> | ||
</ClaimsExchanges> | ||
</OrchestrationStep> | ||
<!-- Check if the user has selected to sign in using one of the social providers --> | ||
<OrchestrationStep Order="2" Type="ClaimsExchange"> | ||
<Preconditions> | ||
<Precondition Type="ClaimsExist" ExecuteActionsIf="true"> | ||
<Value>objectId</Value> | ||
<Action>SkipThisOrchestrationStep</Action> | ||
</Precondition> | ||
</Preconditions> | ||
<ClaimsExchanges> | ||
<ClaimsExchange Id="GoogleExchange" TechnicalProfileReferenceId="Google-OAuth2" /> | ||
<ClaimsExchange Id="SignUpWithLogonEmailExchange" TechnicalProfileReferenceId="LocalAccountSignUpWithLogonEmail" /> | ||
</ClaimsExchanges> | ||
</OrchestrationStep> | ||
<!-- For social IDP authentication, attempt to find the user account in the directory. --> | ||
<OrchestrationStep Order="3" Type="ClaimsExchange"> | ||
<Preconditions> | ||
<Precondition Type="ClaimEquals" ExecuteActionsIf="true"> | ||
<Value>authenticationSource</Value> | ||
<Value>localAccountAuthentication</Value> | ||
<Action>SkipThisOrchestrationStep</Action> | ||
</Precondition> | ||
</Preconditions> | ||
<ClaimsExchanges> | ||
<ClaimsExchange Id="AADUserReadUsingAlternativeSecurityId" TechnicalProfileReferenceId="AAD-UserReadUsingAlternativeSecurityId-NoError" /> | ||
</ClaimsExchanges> | ||
</OrchestrationStep> | ||
<!-- Show self-asserted page only if the directory does not have the user account already (i.e. we do not have an objectId). | ||
This can only happen when authentication happened using a social IDP. If local account was created or authentication done | ||
using ESTS in step 2, then an user account must exist in the directory by this time. --> | ||
<OrchestrationStep Order="4" Type="ClaimsExchange"> | ||
<Preconditions> | ||
<Precondition Type="ClaimsExist" ExecuteActionsIf="true"> | ||
<Value>objectId</Value> | ||
<Action>SkipThisOrchestrationStep</Action> | ||
</Precondition> | ||
</Preconditions> | ||
<ClaimsExchanges> | ||
<ClaimsExchange Id="SelfAsserted-Social" TechnicalProfileReferenceId="SelfAsserted-Social" /> | ||
</ClaimsExchanges> | ||
</OrchestrationStep> | ||
<!-- This step reads any user attributes that we may not have received when authenticating using ESTS so they can be sent | ||
in the token. --> | ||
<OrchestrationStep Order="5" Type="ClaimsExchange"> | ||
<Preconditions> | ||
<Precondition Type="ClaimEquals" ExecuteActionsIf="true"> | ||
<Value>authenticationSource</Value> | ||
<Value>socialIdpAuthentication</Value> | ||
<Action>SkipThisOrchestrationStep</Action> | ||
</Precondition> | ||
</Preconditions> | ||
<ClaimsExchanges> | ||
<ClaimsExchange Id="AADUserReadWithObjectId" TechnicalProfileReferenceId="AAD-UserReadUsingObjectId" /> | ||
</ClaimsExchanges> | ||
</OrchestrationStep> | ||
<!-- The previous step (SelfAsserted-Social) could have been skipped if there were no attributes to collect | ||
from the user. So, in that case, create the user in the directory if one does not already exist | ||
(verified using objectId which would be set from the last step if account was created in the directory. --> | ||
<OrchestrationStep Order="6" Type="ClaimsExchange"> | ||
<Preconditions> | ||
<Precondition Type="ClaimsExist" ExecuteActionsIf="true"> | ||
<Value>objectId</Value> | ||
<Action>SkipThisOrchestrationStep</Action> | ||
</Precondition> | ||
</Preconditions> | ||
<ClaimsExchanges> | ||
<ClaimsExchange Id="AADUserWrite" TechnicalProfileReferenceId="AAD-UserWriteUsingAlternativeSecurityId" /> | ||
</ClaimsExchanges> | ||
</OrchestrationStep> | ||
<OrchestrationStep Order="7" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="JwtIssuer" /> | ||
</OrchestrationSteps> | ||
<ClientDefinition ReferenceId="DefaultWeb" /> | ||
</UserJourney> | ||
</UserJourneys> | ||
<RelyingParty> | ||
<DefaultUserJourney ReferenceId="SignUpOrSignIn_Custom" /> | ||
<TechnicalProfile Id="PolicyProfile"> | ||
<DisplayName>PolicyProfile</DisplayName> | ||
<Protocol Name="OpenIdConnect" /> | ||
<OutputClaims> | ||
<OutputClaim ClaimTypeReferenceId="displayName" /> | ||
<OutputClaim ClaimTypeReferenceId="givenName" /> | ||
<OutputClaim ClaimTypeReferenceId="surname" /> | ||
<OutputClaim ClaimTypeReferenceId="email" /> | ||
<OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="sub" /> | ||
<OutputClaim ClaimTypeReferenceId="identityProvider" /> | ||
<OutputClaim ClaimTypeReferenceId="tenantId" AlwaysUseDefaultValue="true" DefaultValue="{Policy:TenantObjectId}" /> | ||
</OutputClaims> | ||
<SubjectNamingInfo ClaimType="sub" /> | ||
</TechnicalProfile> | ||
</RelyingParty> | ||
</TrustFrameworkPolicy> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters