Skip to content

Instantly share code, notes, and snippets.

View mfcollins3's full-sized avatar

Michael Collins mfcollins3

View GitHub Profile
@mfcollins3
mfcollins3 / login.xml
Created January 21, 2022 18:51
Log in user journey for B2C
<UserJourneys>
<UserJourney Id="LogIn">
<OrchestrationSteps>
<OrchestrationStep Order="1" Type="ClaimsExchange">
<ClaimsExchanges>
<ClaimsExchange Id="ShowLogInForm" TechnicalProfileReferenceId="ShowLogInForm" />
</ClaimsExchanges>
</OrchestrationStep>
<OrchestrationStep Order="2" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="JWTIssuer" />
</OrchestrationSteps>
@mfcollins3
mfcollins3 / login.xml
Last active January 21, 2022 17:25
Log in relying party policy for B2C
<RelyingParty>
<DefaultUserJourney ReferenceId="LogIn" />
<UserJourneyBehaviors>
<JourneyInsights
TelemetryEngine="ApplicationInsights"
InstrumentationKey="7c25e293-8d7e-46c8-9e84-39400c53f1fb"
DeveloperMode="true"
ClientEnabled="true"
ServerEnabled="true"
TelemetryVersion="1.0.0" />
@mfcollins3
mfcollins3 / login.xml
Created January 21, 2022 15:18
Starter skeleton for the B2C log in custom policy
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TrustFrameworkPolicy
xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06"
PolicySchemaVersion="0.3.0.0"
TenantId="projectcenterdev.onmicrosoft.com"
PolicyId="B2C_1A_LogIn"
PublicPolicyUri="http://projectcenterdev.onmicrosoft.com/B2C_1A_LogIn"
DeploymentMode="Development"
UserJourneyRecorderEndpoint="urn:journeyrecorder:applicationinsights">
<BasePolicy>
@mfcollins3
mfcollins3 / signup.xml
Created January 21, 2022 14:48
Updated sign up policy for B2C that inherits from base
<TrustFrameworkPolicy
xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06"
PolicySchemaVersion="0.3.0.0"
TenantId="projectcenterdev.onmicrosoft.com"
PolicyId="B2C_1A_SignUp"
PublicPolicyUri="http://projectcenterdev.onmicrosoft.com/B2C_1A_SignUp"
DeploymentMode="Development"
UserJourneyRecorderEndpoint="urn:journeyrecorder:applicationinsights">
<BasePolicy>
<TenantId>projectcenterdev.onmicrosoft.com</TenantId>
@mfcollins3
mfcollins3 / base.xml
Created January 21, 2022 14:47
Base policy for B2C
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TrustFrameworkPolicy
xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06"
PolicySchemaVersion="0.3.0.0"
TenantId="projectcenterdev.onmicrosoft.com"
PolicyId="B2C_1A_Base"
PublicPolicyUri="http://projectcenterdev.onmicrosoft.com/B2C_1A_Base">
</TrustFrameworkPolicy>
@mfcollins3
mfcollins3 / signup.xml
Created January 21, 2022 06:36
Starter local user sign up relying party policy for B2C
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TrustFrameworkPolicy
xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06"
PolicySchemaVersion="0.3.0.0"
TenantId="projectcenterdev.onmicrosoft.com"
PolicyId="B2C_1A_SignUp"
PublicPolicyUri="http://projectcenterdev.onmicrosoft.com/B2C_1A_SignUp"
DeploymentMode="Development"
UserJourneyRecorderEndpoint="urn:journeyrecorder:applicationinsights">
<BuildingBlocks>
@mfcollins3
mfcollins3 / signup.xml
Created January 21, 2022 06:17
JWTIssuer technical profile for B2C
<ClaimsProvider>
<DisplayName>Token Issuers</DisplayName>
<TechnicalProfiles>
<TechnicalProfile Id="JWTIssuer">
<DisplayName>JWT Issuer</DisplayName>
<Description>Generates and issues the JSON web token containing the user's identity information</Description>
<Protocol Name="OpenIdConnect" />
<OutputTokenFormat>JWT</OutputTokenFormat>
<Metadata>
<Item Key="issuer_refresh_token_user_identity_claim_type">objectId</Item>
@mfcollins3
mfcollins3 / signup.xml
Created January 21, 2022 06:10
SetDisplayNameToSignInName claims transformation for B2C
<BuildingBlocks>
<ClaimsTransformations>
<ClaimsTransformation Id="SetDisplayNameToSignInName" TransformationMethod="CopyClaim">
<InputClaims>
<InputClaim ClaimTypeReferenceId="signInName" TransformationClaimType="inputClaim" />
</InputClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="displayName" TransformationClaimType="outputClaim" />
</OutputClaims>
</ClaimsTransformation>
@mfcollins3
mfcollins3 / signup.xml
Created January 21, 2022 06:00
CreateLocalUser technical profile for B2C
<ClaimsProvider>
<DisplayName>Active Directory</DisplayName>
<TechnicalProfiles>
<TechnicalProfile Id="CreateLocalUser">
<DisplayName>Create Local User Account</DisplayName>
<Description>Creates the local user account in Active Directory</Description>
<Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.AzureActiveDirectoryProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Metadata>
<Item Key="Operation">Write</Item>
<Item Key="RaiseErrorIfClaimsPrincipalAlreadyExists">true</Item>
@mfcollins3
mfcollins3 / signup.xml
Created January 21, 2022 05:42
Sign up form claims for B2C
<BuildingBlocks>
<ClaimsSchema>
<ClaimType Id="signInName">
<DisplayName>Username</DisplayName>
<DataType>string</DataType>
<UserHelpText>Username</UserHelpText>
<UserInputType>TextBox</UserInputType>
</ClaimType>
<ClaimType Id="newPassword">