Skip to content

Instantly share code, notes, and snippets.

@rbrayb
Created October 31, 2022 01:30
Show Gist options
  • Select an option

  • Save rbrayb/52b609508b75be95170e2cbe351ef61a to your computer and use it in GitHub Desktop.

Select an option

Save rbrayb/52b609508b75be95170e2cbe351ef61a to your computer and use it in GitHub Desktop.
Anonymous access to Azure AD B2C
<?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="tenant.onmicrosoft.com"
PolicyId="B2C_1A_Anon_SUSI"
PublicPolicyUri="http://tenant.onmicrosoft.com/B2C_1A_Anon_SUSI">
<BasePolicy>
<TenantId>tenant.onmicrosoft.com</TenantId>
<PolicyId>B2C_1A_TrustFrameworkExtensions</PolicyId>
</BasePolicy>
<BuildingBlocks>
<ClaimsSchema>
<ClaimType Id="anonUser">
<DisplayName>Anonymous User</DisplayName>
<DataType>boolean</DataType>
<AdminHelpText>Specifies whether the user is anonymous.</AdminHelpText>
<UserHelpText>Specifies whether the user is anonymous.</UserHelpText>
</ClaimType>
</ClaimsSchema>
</BuildingBlocks>
<UserJourneys>
<UserJourney Id="AnonSignUpOrSignIn">
<OrchestrationSteps>
<OrchestrationStep Order="1" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="JwtIssuer"/>
</OrchestrationSteps>
</UserJourney>
</UserJourneys>
<RelyingParty>
<DefaultUserJourney ReferenceId="AnonSignUpOrSignIn"/>
<TechnicalProfile Id="PolicyProfile">
<DisplayName>PolicyProfile</DisplayName>
<Protocol Name="OpenIdConnect"/>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="displayName" PartnerClaimType="name" AlwaysUseDefaultValue="true" DefaultValue="Anon User"/>
<OutputClaim ClaimTypeReferenceId="givenName" AlwaysUseDefaultValue="true" DefaultValue="Anon"/>
<OutputClaim ClaimTypeReferenceId="surname" AlwaysUseDefaultValue="true" DefaultValue="User"/>
<OutputClaim ClaimTypeReferenceId="anonUser" AlwaysUseDefaultValue="true" DefaultValue="true"/>
<OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="sub" AlwaysUseDefaultValue="true" DefaultValue="123456"/>
<OutputClaim ClaimTypeReferenceId="tenantId" AlwaysUseDefaultValue="true" DefaultValue="{Policy:TenantObjectId}"/>
</OutputClaims>
<SubjectNamingInfo ClaimType="sub"/>
</TechnicalProfile>
</RelyingParty>
</TrustFrameworkPolicy>
@rbrayb
Copy link
Copy Markdown
Author

rbrayb commented Oct 31, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment