-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
more changes and bumped main package to 0.0.2
- Loading branch information
Mahmoud Swehli
committed
Sep 13, 2023
1 parent
a13cc54
commit aadae81
Showing
15 changed files
with
213 additions
and
157 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
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
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
190 changes: 190 additions & 0 deletions
190
example/custompolicies/B2C_1A_SIGNIN_WITH_OBJECTID_MAGICLINK.xml
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,190 @@ | ||
<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="muljin.onmicrosoft.com" PolicyId="B2C_1A_SIGNIN_WITH_OBJECTID" PublicPolicyUri="http://muljin.onmicrosoft.com/B2C_1A_signin_with_objectid" DeploymentMode="Development" UserJourneyRecorderEndpoint="urn:journeyrecorder:applicationinsights" TenantObjectId="8d2c00a7-5c50-4f59-8011-2faf7454f26f"> | ||
<BasePolicy> | ||
<TenantId>muljin.onmicrosoft.com</TenantId> | ||
<PolicyId>B2C_1A_TrustFrameworkExtensions</PolicyId> | ||
</BasePolicy> | ||
<BuildingBlocks> | ||
<ClaimsSchema> | ||
<!--Sample: Stores the error message for unsolicited request (a request without id_token_hint) and user not found--> | ||
<ClaimType Id="errorMessage"> | ||
<DisplayName>Error</DisplayName> | ||
<DataType>string</DataType> | ||
<UserHelpText>Add help text here</UserHelpText> | ||
<UserInputType>Paragraph</UserInputType> | ||
</ClaimType> | ||
</ClaimsSchema> | ||
<ClaimsTransformations> | ||
<!--Sample: Initiates the errorMessage claims type with the error message--> | ||
<ClaimsTransformation Id="CreateUnsolicitedErrorMessage" TransformationMethod="CreateStringClaim"> | ||
<InputParameters> | ||
<InputParameter Id="value" DataType="string" Value="Invalid magic link. Please try logging in again via the portal and ensure to follow the correct link." /> | ||
</InputParameters> | ||
<OutputClaims> | ||
<OutputClaim ClaimTypeReferenceId="errorMessage" TransformationClaimType="createdClaim" /> | ||
</OutputClaims> | ||
</ClaimsTransformation> | ||
<!--Sample: Initiates the errorMessage claims type with the error message user not found--> | ||
<ClaimsTransformation Id="CreateUserNotFoundErrorMessage" TransformationMethod="CreateStringClaim"> | ||
<InputParameters> | ||
<InputParameter Id="value" DataType="string" Value="The account you have attempted to login with is not registered. Please contact customer support." /> | ||
</InputParameters> | ||
<OutputClaims> | ||
<OutputClaim ClaimTypeReferenceId="errorMessage" TransformationClaimType="createdClaim" /> | ||
</OutputClaims> | ||
</ClaimsTransformation> | ||
</ClaimsTransformations> | ||
</BuildingBlocks> | ||
<ClaimsProviders> | ||
<!--Sample: This technical profile specifies how B2C should validate your token, and what claims you want B2C to extract from the token. | ||
The METADATA value in the TechnicalProfile meta-data is required. | ||
The “IdTokenAudience” and “issuer” arguments are optional (see later section)--> | ||
<ClaimsProvider> | ||
<DisplayName>My ID Token Hint ClaimsProvider</DisplayName> | ||
<TechnicalProfiles> | ||
<TechnicalProfile Id="IdTokenHint_ExtractClaims_ObjectId"> | ||
<DisplayName> My ID Token Hint TechnicalProfile</DisplayName> | ||
<Protocol Name="None" /> | ||
<Metadata> | ||
<Item Key="METADATA">https://muljinmagiclinkexample.azurewebsites.net/oidc/.well-known/openid-configuration</Item> | ||
<!-- <Item Key="IdTokenAudience">your_optional_audience_override</Item> --> | ||
<!-- <Item Key="issuer">your_optional_token_issuer_override</Item> --> | ||
</Metadata> | ||
<OutputClaims> | ||
<!--Sample: Read the object id claim from the id_token_hint--> | ||
<OutputClaim ClaimTypeReferenceId="objectId" /> | ||
</OutputClaims> | ||
</TechnicalProfile> | ||
</TechnicalProfiles> | ||
</ClaimsProvider> | ||
<ClaimsProvider> | ||
<DisplayName>Self Asserted</DisplayName> | ||
<TechnicalProfiles> | ||
<!-- Demo: Show error message--> | ||
<TechnicalProfile Id="SelfAsserted-Error"> | ||
<DisplayName>Unsolicited error message</DisplayName> | ||
<Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" /> | ||
<Metadata> | ||
<Item Key="ContentDefinitionReferenceId">api.selfasserted</Item> | ||
<!-- Sample: Remove the continue button--> | ||
<Item Key="setting.showContinueButton">false</Item> | ||
</Metadata> | ||
<InputClaims> | ||
<InputClaim ClaimTypeReferenceId="errorMessage" /> | ||
</InputClaims> | ||
<OutputClaims> | ||
<OutputClaim ClaimTypeReferenceId="errorMessage" /> | ||
</OutputClaims> | ||
</TechnicalProfile> | ||
<!-- Demo: Show unsolicited error message--> | ||
<TechnicalProfile Id="SelfAsserted-Unsolicited"> | ||
<InputClaimsTransformations> | ||
<InputClaimsTransformation ReferenceId="CreateUnsolicitedErrorMessage" /> | ||
</InputClaimsTransformations> | ||
<IncludeTechnicalProfile ReferenceId="SelfAsserted-Error" /> | ||
</TechnicalProfile> | ||
<!-- Demo: Show user not found error message--> | ||
<TechnicalProfile Id="SelfAsserted-UserNotFound"> | ||
<InputClaimsTransformations> | ||
<InputClaimsTransformation ReferenceId="CreateUserNotFoundErrorMessage" /> | ||
</InputClaimsTransformations> | ||
<IncludeTechnicalProfile ReferenceId="SelfAsserted-Error" /> | ||
</TechnicalProfile> | ||
</TechnicalProfiles> | ||
</ClaimsProvider> | ||
<ClaimsProvider> | ||
<DisplayName>Azure Active Directory</DisplayName> | ||
<TechnicalProfiles> | ||
<TechnicalProfile Id="AAD-UserReadUsingObjectId"> | ||
<Metadata> | ||
<!--Sample: don't raise error if user not found. We have an orchestration step to handle the error message--> | ||
<Item Key="RaiseErrorIfClaimsPrincipalDoesNotExist">false</Item> | ||
</Metadata> | ||
<OutputClaims> | ||
<!--Sample: add optional claims to read from the directory--> | ||
<OutputClaim ClaimTypeReferenceId="givenName" /> | ||
<OutputClaim ClaimTypeReferenceId="surname" /> | ||
</OutputClaims> | ||
</TechnicalProfile> | ||
</TechnicalProfiles> | ||
</ClaimsProvider> | ||
<ClaimsProvider> | ||
<DisplayName>Token Issuer</DisplayName> | ||
<TechnicalProfiles> | ||
<TechnicalProfile Id="JwtIssuer"> | ||
<Metadata> | ||
<Item Key="token_lifetime_secs">3600</Item> | ||
<Item Key="id_token_lifetime_secs">3600</Item> | ||
<Item Key="refresh_token_lifetime_secs">7776000</Item> | ||
<Item Key="rolling_refresh_token_lifetime_secs">7776000</Item> | ||
<Item Key="allow_infinite_rolling_refresh_token">true</Item> | ||
<!-- <Item Key="IssuanceClaimPattern">AuthorityAndTenantGuid</Item> | ||
<Item Key="AuthenticationContextReferenceClaimPattern">None</Item> --> | ||
</Metadata> | ||
</TechnicalProfile> | ||
</TechnicalProfiles> | ||
</ClaimsProvider> | ||
</ClaimsProviders> | ||
<UserJourneys> | ||
<UserJourney Id="SignInWithObjectIdToken"> | ||
<OrchestrationSteps> | ||
<!--Sample: Read the input claims from the id_token_hint--> | ||
<OrchestrationStep Order="1" Type="GetClaims" CpimIssuerTechnicalProfileReferenceId="IdTokenHint_ExtractClaims_ObjectId" /> | ||
<!-- Sample: Check if user tries to run the policy without invitation --> | ||
<OrchestrationStep Order="2" Type="ClaimsExchange"> | ||
<Preconditions> | ||
<Precondition Type="ClaimsExist" ExecuteActionsIf="true"> | ||
<Value>objectId</Value> | ||
<Action>SkipThisOrchestrationStep</Action> | ||
</Precondition> | ||
</Preconditions> | ||
<ClaimsExchanges> | ||
<ClaimsExchange Id="SelfAsserted-Unsolicited" TechnicalProfileReferenceId="SelfAsserted-Unsolicited" /> | ||
</ClaimsExchanges> | ||
</OrchestrationStep> | ||
<!--Sample: Read the user properties from the directory--> | ||
<OrchestrationStep Order="3" Type="ClaimsExchange"> | ||
<ClaimsExchanges> | ||
<ClaimsExchange Id="AADUserReadUsingObjectId" TechnicalProfileReferenceId="AAD-UserReadUsingObjectId" /> | ||
</ClaimsExchanges> | ||
</OrchestrationStep> | ||
<!-- Sample: Check whether the user not existed in the directory --> | ||
<OrchestrationStep Order="4" Type="ClaimsExchange"> | ||
<Preconditions> | ||
<Precondition Type="ClaimsExist" ExecuteActionsIf="true"> | ||
<Value>objectId</Value> | ||
<Action>SkipThisOrchestrationStep</Action> | ||
</Precondition> | ||
</Preconditions> | ||
<ClaimsExchanges> | ||
<ClaimsExchange Id="SelfAssertedUserNotFound" TechnicalProfileReferenceId="SelfAsserted-UserNotFound" /> | ||
</ClaimsExchanges> | ||
</OrchestrationStep> | ||
<!--Sample: Issue an access token--> | ||
<OrchestrationStep Order="5" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="JwtIssuer" /> | ||
</OrchestrationSteps> | ||
<ClientDefinition ReferenceId="DefaultWeb" /> | ||
</UserJourney> | ||
</UserJourneys> | ||
<RelyingParty> | ||
<DefaultUserJourney ReferenceId="SignInWithObjectIdToken" /> | ||
<UserJourneyBehaviors> | ||
<JourneyInsights TelemetryEngine="ApplicationInsights" InstrumentationKey="9362c996-c7fd-49de-98bc-f1a3a4ff7a26" DeveloperMode="true" ClientEnabled="false" ServerEnabled="true" TelemetryVersion="1.0.0" /> | ||
</UserJourneyBehaviors> | ||
<TechnicalProfile Id="PolicyProfile"> | ||
<DisplayName>PolicyProfile</DisplayName> | ||
<Protocol Name="OpenIdConnect" /> | ||
<!--Sample: Set the input claims to be read from the id_token_hint--> | ||
<InputClaims> | ||
<InputClaim ClaimTypeReferenceId="objectId" /> | ||
</InputClaims> | ||
<OutputClaims> | ||
<OutputClaim ClaimTypeReferenceId="displayName" /> | ||
<OutputClaim ClaimTypeReferenceId="givenName" /> | ||
<OutputClaim ClaimTypeReferenceId="surname" /> | ||
<OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="sub" /> | ||
<OutputClaim ClaimTypeReferenceId="tenantId" AlwaysUseDefaultValue="true" DefaultValue="{Policy:TenantObjectId}" /> | ||
</OutputClaims> | ||
<SubjectNamingInfo ClaimType="sub" /> | ||
</TechnicalProfile> | ||
</RelyingParty> | ||
</TrustFrameworkPolicy> |
33 changes: 0 additions & 33 deletions
33
...2CMagicLink/Examples/Muljin.B2CMagicLink.Example/Controllers/WeatherForecastController.cs
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
...ljin.B2CMagicLink/Examples/Muljin.B2CMagicLink.Example/Muljin.B2CMagicLink.Example.csproj
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
src/Muljin.B2CMagicLink/Examples/Muljin.B2CMagicLink.Example/Program.cs
This file was deleted.
Oops, something went wrong.
41 changes: 0 additions & 41 deletions
41
src/Muljin.B2CMagicLink/Examples/Muljin.B2CMagicLink.Example/Properties/launchSettings.json
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
src/Muljin.B2CMagicLink/Examples/Muljin.B2CMagicLink.Example/WeatherForecast.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.