Created
April 4, 2023 08:26
-
-
Save rbrayb/d36a20fe74cf70e06e050d9b932afd27 to your computer and use it in GitHub Desktop.
Displaying the access token when federating with Azure AD B2C
This file contains hidden or 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
| <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="tenant.onmicrosoft.com" PolicyId="B2C_1A_DISPLAYTOKEN" | |
| PublicPolicyUri="http://tenant.onmicrosoft.com/B2C_1A_DISPLAYTOKEN" | |
| DeploymentMode="Development" UserJourneyRecorderEndpoint="urn:journeyrecorder:applicationinsights" | |
| TenantObjectId="d7c...a9"> | |
| <BasePolicy> | |
| <TenantId>tenant.onmicrosoft.com</TenantId> | |
| <PolicyId>B2C_1A_EXTENSIONS</PolicyId> | |
| </BasePolicy> | |
| <BuildingBlocks> | |
| <ClaimsSchema> | |
| <ClaimType Id="givenName"> | |
| <UserInputType>Readonly</UserInputType> | |
| </ClaimType> | |
| <ClaimType Id="surname"> | |
| <UserInputType>Readonly</UserInputType> | |
| </ClaimType> | |
| <ClaimType Id="identityProviderAccessToken"> | |
| <DisplayName>Identity Provider Access Token</DisplayName> | |
| <DataType>string</DataType> | |
| <AdminHelpText>Stores the access token of the identity provider.</AdminHelpText> | |
| </ClaimType> | |
| </ClaimsSchema> | |
| </BuildingBlocks> | |
| <ClaimsProviders> | |
| <ClaimsProvider> | |
| <DisplayName>Login using Azure AD</DisplayName> | |
| <TechnicalProfiles> | |
| <!-- SSO - Federation --> | |
| <TechnicalProfile Id="OIDC-Display"> | |
| <DisplayName>OIDC-Display"</DisplayName> | |
| <Description>Login with your federation account</Description> | |
| <Protocol Name="OpenIdConnect" /> | |
| <Metadata> | |
| <Item Key="METADATA">https://login.microsoftonline.com/tenant.onmicrosoft.com/v2.0/.well-known/openid-configuration</Item> | |
| <Item Key="client_id">b4e...5d16</Item> | |
| <Item Key="response_types">code</Item> | |
| <Item Key="scope">openid profile email User.Read</Item> | |
| <Item Key="response_mode">form_post</Item> | |
| <Item Key="HttpBinding">POST</Item> | |
| <Item Key="UsePolicyInRedirectUri">false</Item> | |
| </Metadata> | |
| <CryptographicKeys> | |
| <Key Id="client_secret" StorageReferenceId="B2C_1A_Federation" /> | |
| </CryptographicKeys> | |
| <InputClaims> | |
| <!-- Pass the login_hint to Azure AD home realm discovery page --> | |
| <InputClaim ClaimTypeReferenceId="signInName" PartnerClaimType="login_hint" /> | |
| </InputClaims> | |
| <OutputClaims> | |
| <OutputClaim ClaimTypeReferenceId="issuerUserId" PartnerClaimType="upn" /> | |
| <OutputClaim ClaimTypeReferenceId="userPrincipalName" PartnerClaimType="userPrincipalName" /> | |
| <OutputClaim ClaimTypeReferenceId="givenName" PartnerClaimType="given_name" /> | |
| <OutputClaim ClaimTypeReferenceId="surName" PartnerClaimType="family_name" /> | |
| <OutputClaim ClaimTypeReferenceId="displayName" PartnerClaimType="name" /> | |
| <OutputClaim ClaimTypeReferenceId="identityProviderAccessToken" PartnerClaimType="{oauth2:access_token}" /> | |
| <OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="socialIdpAuthentication" AlwaysUseDefaultValue="true" /> | |
| <OutputClaim ClaimTypeReferenceId="identityProvider" PartnerClaimType="iss" /> | |
| </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="SUSI-Display"> | |
| <OrchestrationSteps> | |
| <OrchestrationStep Order="1" Type="CombinedSignInAndSignUp" ContentDefinitionReferenceId="api.signuporsignin"> | |
| <ClaimsProviderSelections> | |
| <ClaimsProviderSelection TargetClaimsExchangeId="Federation" /> | |
| </ClaimsProviderSelections> | |
| </OrchestrationStep> | |
| <!-- Federate --> | |
| <OrchestrationStep Order="2" Type="ClaimsExchange"> | |
| <ClaimsExchanges> | |
| <ClaimsExchange Id="Federation" TechnicalProfileReferenceId="OIDC-Display" /> | |
| </ClaimsExchanges> | |
| </OrchestrationStep> | |
| <OrchestrationStep Order="3" Type="SendClaims" | |
| CpimIssuerTechnicalProfileReferenceId="JwtIssuer" /> | |
| </OrchestrationSteps> | |
| <ClientDefinition ReferenceId="DefaultWeb" /> | |
| </UserJourney> | |
| </UserJourneys> | |
| <RelyingParty> | |
| <DefaultUserJourney ReferenceId="SUSI-Display" /> | |
| <Endpoints> | |
| <Endpoint Id="UserInfo" UserJourneyReferenceId="UserInfoJourney" /> | |
| </Endpoints> | |
| <UserJourneyBehaviors> | |
| <JourneyInsights TelemetryEngine="ApplicationInsights" InstrumentationKey="c...4cb" DeveloperMode="true" ClientEnabled="true" ServerEnabled="true" TelemetryVersion="1.0.0" /> | |
| <ScriptExecution>Allow</ScriptExecution> | |
| </UserJourneyBehaviors> | |
| <TechnicalProfile Id="PolicyProfile"> | |
| <DisplayName>PolicyProfile</DisplayName> | |
| <Protocol Name="OpenIdConnect" /> | |
| <OutputClaims> | |
| <OutputClaim ClaimTypeReferenceId="displayName" PartnerClaimType="name" /> | |
| <OutputClaim ClaimTypeReferenceId="givenName" PartnerClaimType="first_name" /> | |
| <OutputClaim ClaimTypeReferenceId="surName" PartnerClaimType="family_name" /> | |
| <!-- <OutputClaim ClaimTypeReferenceId="signInName" PartnerClaimType="username" /> --> | |
| <OutputClaim ClaimTypeReferenceId="identityProviderAccessToken" PartnerClaimType="idp_access_token"/> | |
| <OutputClaim ClaimTypeReferenceId="issuerUserId" PartnerClaimType="sub" /> | |
| <OutputClaim ClaimTypeReferenceId="tenantId" AlwaysUseDefaultValue="true" | |
| DefaultValue="{Policy:TenantObjectId}" /> | |
| </OutputClaims> | |
| <SubjectNamingInfo ClaimType="sub" /> | |
| </TechnicalProfile> | |
| </RelyingParty> | |
| </TrustFrameworkPolicy> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://medium.com/the-new-control-plane/displaying-the-access-token-when-federating-with-azure-ad-b2c-6d283127134a