Skip to content

Commit

Permalink
Merge pull request #450 from egjoleka/kmsi-jwt
Browse files Browse the repository at this point in the history
added kmsi persisted claim in jwt
  • Loading branch information
JasSuri authored Jan 27, 2025
2 parents 3a92256 + 9de6f2b commit b601cdd
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions policies/kmsi-claim-jwt/policy/KMSIJWTExtension.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?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="yourtenant.onmicrosoft.com"
PolicyId="B2C_1A_CR_Context"
PublicPolicyUri="http://yourtenant.onmicrosoft.com/B2C_1A_CR_Context">

<BasePolicy>
<TenantId>yourtenant.onmicrosoft.com</TenantId>
<PolicyId>B2C_1A_TrustFrameworkExtensions</PolicyId>
</BasePolicy>

<BuildingBlocks>
<ClaimsSchema>
<ClaimType Id="ContextKMSI">
<DisplayName>{Context:KMSI}</DisplayName>
<DataType>string</DataType>
</ClaimType>
</ClaimsSchema>
</BuildingBlocks>

<ClaimsProviders>
<ClaimsProvider>
<DisplayName>Unit tests</DisplayName>
<TechnicalProfiles>
<TechnicalProfile Id="KMSITokenTechnicalProfile">
<DisplayName>Pass the KMIS value</DisplayName>
<Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.ClaimsTransformationProtocolProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Metadata>
<Item Key="IncludeClaimResolvingInClaimsHandling">true</Item>
</Metadata>
<InputClaims>
<InputClaim ClaimTypeReferenceId="ContextKMSI" AlwaysUseDefaultValue="true" DefaultValue="{CONTEXT:KMSI}" />
</InputClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="ContextKMSI" />
</OutputClaims>
<UseTechnicalProfileForSessionManagement ReferenceId="SM-AAD-KMSI" />
</TechnicalProfile>
<TechnicalProfile Id="SM-AAD-KMSI">
<DisplayName>Session Mananagement Provider</DisplayName>
<Protocol Name="Proprietary" Handler="Web.TPEngine.SSO.DefaultSSOSessionProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
<PersistedClaims>
<PersistedClaim ClaimTypeReferenceId="ContextKMSI" />
</PersistedClaims>
</TechnicalProfile>
</TechnicalProfiles>
</ClaimsProvider>
</ClaimsProviders>

<UserJourneys>
<UserJourney Id="UnitTestJourney">
<OrchestrationSteps>
<OrchestrationStep Order="1" Type="ClaimsExchange">
<ClaimsExchanges>
<ClaimsExchange Id="KMSITokenTechnicalProfile" TechnicalProfileReferenceId="KMSITokenTechnicalProfile" />
</ClaimsExchanges>
</OrchestrationStep>
<OrchestrationStep Order="2" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="JwtIssuer" />
</OrchestrationSteps>
</UserJourney>
</UserJourneys>

<RelyingParty>
<DefaultUserJourney ReferenceId="UnitTestJourney" />
<TechnicalProfile Id="PolicyProfile">
<DisplayName>PolicyProfile</DisplayName>
<Protocol Name="OpenIdConnect" />
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="sub" DefaultValue="1234" />
<OutputClaim ClaimTypeReferenceId="ContextBuildNumber" />
<OutputClaim ClaimTypeReferenceId="ContextCorrelationId" />
<OutputClaim ClaimTypeReferenceId="ContextDateTimeInUtc" />
<OutputClaim ClaimTypeReferenceId="ContextDeploymentMode" />
<OutputClaim ClaimTypeReferenceId="ContextIPAddress" />
<OutputClaim ClaimTypeReferenceId="ContextHostName" />
<OutputClaim ClaimTypeReferenceId="ContextKMSI" PartnerClaimType="kmsi"/>
</OutputClaims>
<SubjectNamingInfo ClaimType="sub" />
</TechnicalProfile>
</RelyingParty>
</TrustFrameworkPolicy>

0 comments on commit b601cdd

Please sign in to comment.