Giter Site home page Giter Site logo

azure-ad-b2c / samples Goto Github PK

View Code? Open in Web Editor NEW
802.0 48.0 593.0 56.29 MB

Azure AD B2C custom policy solutions and samples.

C# 42.29% HTML 44.30% CSS 3.31% JavaScript 5.70% PowerShell 4.28% Batchfile 0.07% ASP.NET 0.04%
azure-active-directory-b2c custom-policy azure-ad-b2c azure-ad-b2c-custom

samples's Introduction

Azure Active Directory B2C: Custom CIAM User Journeys

In this repo, you will find samples for several enhanced Azure AD B2C Custom CIAM User Journeys.

Getting started

Prerequisites

Sample scenarios

Samples are available for the following categories

Password management

Sample name Description Quick deploy Demo
Password reset via email or phone verification Verify a user via Email or SMS on a single screen. Go Live demo
Force password reset As an administrator, you can reset a user's password if the user forgets their password or you would like to force them to reset the password. In this policy sample, you'll learn how to force a password reset in these scenarios. Go Live demo
Force password reset first logon Force a user to reset their password on the first logon. Go
Force password after 90 days Force a user to reset their password after 90 days from the last time user set their password. Go
Password reset only Prevents issuing an access token to the user after resetting their password. Go Live demo
Sign-up and sign-in with embedded password reset Embed the password reset flow a part of the sign-up or sign-in policy without the AADB2C90118 error message. Go Live demo
Password Reset with Phone Number Reset a users password using Phone Number (SMS or Phone Call).
Password reset without the ability to use the last password Force password reset/change flow where the user cannot use their currently set password. Go Live demo
Banned password list Banned password list prevention during Sign up and password reset/change flow. This sample does not use an API. Go Live demo
Password Reset sends verification code only if the email is registered Display control to send verification code to users only if the email is registered against a user in the directory. Go Live demo
Password history Prevent the previous Nth password to be set during password reset/change. Requires using external storage and web services. NA

General security

Sample name Description Quick deploy Demo
Revoke Azure AD B2C session cookies Demonstrates how to revoke the the single sign on cookies after a refresh token has been revoked. Go
Google Captcha on Sign In An example set of policies which integrate Google Captcha into the sign in journey. NA
Disable and lockout an account after a period of inactivity For scenarios where you need to prevent users logging into the application after a set number of days. The account will also be disabled at the time of the users login attempt in the case the user logs in after the time period. Go
Restrict B2C Policy to specific App Registration Only permits certain application registrations to call certain B2C policy Id's. Go Live demo
Impersonation Flow For scenarios where you require one user to impersonate another user. This is common for support desk or delegated administration of a user in an application or service. It is recommended to always issue the token of the original authenticated user and append additional information about the targeted impersonated user as part of the auth flow Go
Social identity provider force email verification When a user signs in with a social account, in some scenarios, the identity provider doesn't share the email address. This sample demonstrates how to force the user to provide and validate an email address. NA Live demo
Sign-in with social identity provider and force email uniqueness Demonstrates how to force a social account user to provide and validate their email address, and also checks that there is no other account with the same email address. NA
Preventing logon for Social or External IdP Accounts when Disabled in AAD B2C For scenarios where you would like to prevent logons via Social or External IdPs when the account has been disabled in Azure AD B2C. NA
User groups Returns the user security groups. NA
Sign-in with Conditional access Azure Active Directory (Azure AD) Conditional Access is the tool used by Azure AD B2C to bring signals together, make decisions, and enforce organizational policies. Automating risk assessment with policy conditions means risky sign-ins are at once identified and remediated or blocked. Go Live demo
Allow/Deny based on Hostname This sample provides an example of how to block access to particular B2C policy based on the [Hostname] of the request, e.g. allow requests made to the policy using login.contoso.com but block foo.b2clogin.com. Useful when using custom domain(s) with Azure AD B2C. Go
Call center validation A call center uses Azure AD B2C to validate a customer phoning in. To do this, the call center takes three characters from the password and asks the customer calling in to provide the three characters plus some other known facts as part of the authentication process. NA
Measure the time of the user journey Shows how to measure the time takes the user complete the sign-up or sign-in flow. NA

User Experience

Sample name Description Quick deploy Demo
Dynamic sign up or sign in allows dynamically detecting whether a user can sign in or sign up. The user enters their email and is asked to verify their password if the account exists. If the account does not exist, the user goes through a sign up flow. Go Live demo
Split Sign-up into separate steps for email verification and account creation When you don't want to use the default Sign-up page which shows both email verification and user registration controls on the same page at once. This sample splits the default sign-up behavior into two separate steps. First step performs Email Verification only, avoiding all other default fields related to users registration. Second step (if email verification was successful) takes the users to a new screen where they can actually create their accounts. This uses Azure AD to send out emails, no separate email provider integrations needed. Go Live demo
Sign In and Sign Up with Username or Email This sample combines the UX of both the Email and Username based journeys. Go Live demo
Local account change sign-in name email address During sign-in with a local account, a user may want to change the sign-in name (email address). This sample policy demonstrates how to allow a user to provide and validate a new email address, and store the new email address to the Azure Active Directory user account. After the user changes their email address, subsequent logins require the use of the new email address. Go Live demo
Username discovery This example shows how to discover a username by email address. It's useful when a user has forgotten their username and remembers only their email address. NA
Sign-in with Home Realm Discovery and Default IdP Demonstrates how to implement a sign in journey, where the user is automatically directed to their federated identity provider based off of their email domain. And for users who arrive with an unknown domain, they are redirected to a default identity provider. NA
Email delivered account redemption link This sample demonstrates how to allow the user to sign up to a web application by providing their email which sends the user a magic link to complete their account creation to their email. NA
Sign-in with a magic link This sample demonstrates how a user can sign in to your web application by sending them a sign-in link. A magic link can be used to pre-populate user information, or accelerate the user through the user journey. NA
Username based journey For scenarios where you would like users to sign up and sign in with Usernames rather than Emails. Go Live demo
Dynamic identity provider selection Demonstrates how to dynamically filter the list of social identity providers rendered to the user based on the requests application ID. In the following screenshot user can select from the list of identity providers, such as Facebook, Google+ and Amazon. With Azure AD B2C custom policies, you can configure the technical profiles to be displayed based a claim's value. The claim value contains the list of identity providers to be rendered. NA
Home Realm Discovery page Demonstrates how to create a home realm discovery page. On the sign-in page, the user provides their sign-in email address and clicks continue. B2C checks the domain portion of the sign-in email address. If the domain name is contoso.com the user is redirected to Contoso.com Azure AD to complete the sign-in. Otherwise the user continues the sign-in with username and password. In both cases (AAD B2C local account and AAD account), the user does not need to retype the user name. NA
Delete my account Demonstrates how to delete a local or social account from the directory Go Live demo
Integrate REST API claims exchanges and input validation A sample .Net core web API, demonstrates the use of Restful technical profile in user journey's orchestration step and as a validation technical profile. NA
sign-up or sign-in policy with a deep link to sign-up page Adds a direct link to the sign-up page. A relying party application can include a query string parameter that takes the user directly to the sign-up page. Go Live demo
Allow sign up from specific email domains This policy demonstrates how to validate the email address domain name against a list of allowed domains. Go Live demo
Dynamically set HTML attributes from claims This policy demonstrates how to take a claim value (passwordrules in this case) and dynamically add it to an HTML element (newpassword and re-enter password in this case). This example uses the iOS passwordrules attribute as an example. NA

Terms of Use/Consent

Sample name Description Quick deploy Demo
Provide consent UI to API scopes For scenarios where you provide a plug and play service to other partners. When the user chooses to use your service through a partner application, the user must login with their account with your service, and consent to various scopes which allow your service to share information with the partner application. Go Live demo
Sign Up and Sign In with dynamic 'Terms of Use' prompt Demonstrates how to incorporate a TOU or T&Cs into your user journey with the ability for users to be prompted to re-consent when the TOU/T&Cs change. Go
Azure AD B2C Invitation This sample console app demonstrates how to send a sign-up email invitation. After you sent the invitation, the user clicks on the Confirm account link, which opens the sign-up page (without the need to validate the email again). Use this approach when you need to create the users account beforehand, while allowing the user to choose the password on initial sign in. This approach is better than creating an account via Graph API and sending the password to the user via some communication means. NA
GDPR Age Gating Enables you to identify minors that want to use your application, with, or without parental consent. You can choose to block the minor from signing-in to the application. Go

Passwordless

Sample name Description Quick deploy
Password-less sign-in with email verification Password-less authentication is a type of authentication where user doesn't need to sign-in with their password. This is commonly used in B2C scenarios where users use your application infrequently and tend to forget their password. This sample policy demonstrates how to allow user to sign-in, simply by providing and verifying the sign-in email address using OTP code (one time password). Go
Login with Phone Number An example set of policies for password-less login via Phone Number (SMS or Phone Call). Go

Multi factor

Sample name Description Quick deploy Demo
Microsoft Authenticator TOTP Integrate native Microsoft Authenticator TOTP flow - Enroll a user in TOTP with an authenticator app Go Live demo
Custom email verification - DisplayControls Allows you to send your own custom email verification email during sign-up or password reset user journey's. The is a working example of the sample reference on the Microsoft B2C documentation site - Custom email verification in Azure Active Directory B2C NA
Custom SMS provider - DisplayControls Integrate a custom SMS provider in Azure Active Directory B2C (Azure AD B2C) to customized SMS' to users that perform multi factor authentication to your application. By using DisplayControls (currently in preview) and a third-party SMS provider, you can use your own contextualized SMS message, custom Phone Number, as well as support localization and custom one-time password (OTP) settings. NA
Email second-factor For scenarios where you would like users to validate their email via OTP on every sign in. Go Live demo
Sign-in with FIDO Demonstrates how to sign-in with a FIDO authenticator (as a first factor authentication). This policy use the WebAuthn standard to register new credential and sign-in with FIDO credential. NA
Integrate Twilio Verify API for PSD2 SCA The following sample guides you through integrating Azure AD B2C authentication with Twilio Verify API to enable your organization to meet PSD2 SCA requirements. NA
Edit MFA phone number Demonstrates how to allow user to provide and validate a new MFA phone number. After the user changes their MFA phone number, on the next login, the user needs to provide the new phone number instead of the old one. Go Live demo
Restore MFA phone number Demonstrates how to allow user to change the phone in case it got lost. After the user changes their MFA phone number, on the next login, the user needs to provide the new phone number instead of the old one. Go Live demo
Sign In With Authenticator This is a sample to show how you can create a B2C Custom Policy to signin with Authenticator Apps to B2C. It is related to the custom-mfa-totp sample, which shows how to use the Authenticator app as MFA. NA
Authy App multi-factor authentication Custom MFA solution, based on Authy App (push notification). Allowing users to sign-in with Twilio Auth App (authenticator apps). NA
MFA with either Phone (Call/SMS) or Email verification Allow the user to do MFA by either Phone (Call/SMS) or Email verification, with the ability to change this preference via Profile Edit. Go Live demo
Add & Select 2 MFA phone numbers at SignIn/SignUp Demonstrates how to store two phone numbers in a secure manner in B2C and choose between any two at signIn. The flow prompts the user to store a secondary phone if only one phone number is one file. Once the two numbers are stored as part of SignUp or SignIn the user is given a choice to select between the two phones for their MFA on subsequent signIns. Go Live demo
MFA after timeout or IP change A policy which forces the user to do MFA on 3 conditions: The user has newly signed up, the user has not done MFA in the last X seconds, the user is logging in from a different IP than they last logged in from. Go
Unknown Devices MFA - device fingerprinting Demonstrates how to detect unknown devices which might be required to prompt MFA as illustrated in this particular sample or send email to the user signing in from unknown device. Go

Account linking

Sample name Description Quick deploy
Auto account linking This policy sample demonstrates how to link an account when a user arrives with the same email as an existing account. When the email is detected as being the same, the user is prompted to sign in with one of the methods already registered on the existing account. Once complete, the account is linked. Go
Account linkage (new version, one policy for both link and unlink) - With Azure AD B2C an account can have multiple identities, local (username and password) or social/enterprise identity (such as Facebook or AAD). This Azure AD B2C sample demonstrates how to link and unlink existing Azure AD B2C account to a social identity. Unified policy for link and unlink. NA
Account linkage (a policy for link and another policy for unlink.) - With Azure AD B2C an account can have multiple identities, local (username and password) or social/enterprise identity (such as Facebook or AAD). This Azure AD B2C sample demonstrates how to link and unlink existing Azure AD B2C account to a social identity. NA
Link a local account to federated account Demonstrates how to link a user who logged in via a federated provider to a pre-created AAD B2C Local Account. NA
Sign-up with social and local account Demonstrate how to create a policy that allows a user to sign-up with a social account linked to local account NA

Identity providers

Sample name Description Quick deploy
Sign in with Apple as a Custom OpenID Connect identity provider Demonstrates how to gather the correct configuration information to setup Sign in with Apple as an OpenID Connect identity provider. NA
Sign in with Kakao This sample shows how to setup Kakao as an identity provider in Azure AD B2C. Kakao is a South Korean Internet company that provides a diverse set of services. NA
Sign in with REST API identity provider Demonstrates how allow users to sign-in with credentials stored in a legacy identity provider using REST API services. NA
Sign in through Azure AD as the identity provider, and include original Idp token Demonstrates how to sign in through a federated identity provider, Azure AD, and include the original identity provider token (Azure AD Bearer Token) as part of the B2C issued token. NA
Custom claims provider A custom OpenId connect claims provider that federates with Azure AD B2C over OIDC protocol. NA
Obtain the Microsoft Graph access token for an Azure AD Federated logon For scenarios where we would like to obtain the Microsoft Graph API token for a Azure AD federated logon in the context of the logged in user. For example this could be used to read the users Exchange Online mailbox within an Azure AD B2C application. NA
AAD Authentication with REST Pass through authentication to Azure AD (no user created in B2C), then calls a REST API to obtain more claims. NA

User interface

Sample name Description Quick deploy
Render dynamic dropdown box For scenarios where you would like to fetch information during the runtime of the authentication flow, and display this data as a dropdown box dynamically for the user to make a selection. In this example, a users identifier is sent to an API, which returns a set of emails for them to select. The selected email is returned in the token. NA

Data residency

Sample name Description Quick deploy
Remote profile Demonstrates how to store and read user profiles from a remote database. NA
Remote profile geo-based Demonstrates storing user profile either in B2C directory or in different Azure Table Storages based in user geography setting. NA
Encrypted profile Demonstrates how to store and read user profiles from Azure AD B2C using encrypted data. NA

User migration

Sample name Description Quick deploy
Seamless account migration Where accounts have been pre-migrated into Azure AD B2C and you want to update the password on the account on initial sign in. Azure AD B2C calls a REST API to validate the credentials for accounts marked as requiring migration (via attribute) against a legacy identity provider, returns a successful response to Azure AD B2C, and Azure AD B2C writes the password to the account in the directory. NA
Seamless account migration from AWS This is an end-to-end sample for migrating the users from AWS Cognito to Azure AD B2C. NA
Just in time migration v1 In this sample Azure AD B2C calls a REST API that validates the credential, and migrate the account with a Graph API call. NA
Just in time migration v2 In this sample Azure AD B2C calls a REST API to validate the credentials, return the user profile to B2C from an Azure Table, and B2C creates the account in the directory.
B2C to B2C Migration Migrate users from one B2C instance to another using just in time migration. NA

Endpoints

Sample name Description Quick deploy
UserInfo endpoint The UserInfo endpoint is part of the OpenID Connect standard (OIDC) specification and is designed to return claims about the authenticated user. The UserInfo endpoint is defined in the relying party policy using the EndPoint element. Go
Token endpoint Demonstrate how to add a refresh token journey to your custom policy Go

Web Test

Sample name Description Quick deploy
SignIn Web Test using Azure App Insights This sample web test shows how to run tests and monitor results of B2C sign in's, using Azure Application Insights. NA
A/B testing Demonstrate how to add configure A/B testing Go

CI/CD

Sample name Description Quick deploy
Azure DevOps pipeline for Azure AD B2C Uploads policies regardless of naming convention Azure DevOps automated pipeline. NA
Github Action for Azure AD B2C using ieftool A fully featured github action that provides a way for you to inject variables into your b2c policies and upload them regardless of order. NA

Community Help and Support

Use Stack Overflow to get support from the community. Ask your questions on Stack Overflow first and browse existing issues to see if someone has asked your question before. Make sure that your questions or comments are tagged with [azure-ad-b2c]. If you find a bug in the sample, please raise the issue on GitHub Issues. To provide product feedback, visit the Azure Active Directory B2C Feedback page.

samples's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

samples's Issues

You can utilize the Microsoft Graph API to populate the "can_impersonate" extended attribute

In the "Impersonation Flow for Azure AD B2C - https://github.com/azure-ad-b2c/samples/tree/master/policies/impersonation " procedure, instead of having the users populate the "extension_GUID_can_impersonate" attribute using the Azure Graph API Explorer ( https://graphexplorer.azurewebsites.net/ ), you can have them utilize the Microsoft Graph API Explorer ( https://developer.microsoft.com/en-us/graph/graph-explorer) . Listed below is what they can do.

After doing this, the Impersonation Flow for Azure AD B2C policy should work as desired

Policy: pwd-reset-email-exists - How to Localize the "emailVerificationControl_error_message"

Hello,

I'm using this example to write my own policy and everything is working fine.
In my custom policy I have French and English and was able to translate every message that is displayed to the user but this message "The verification has failed, please try again.", which is shown if the user enters an incorrect Verification Code (Id="emailVerificationControl_error_message")

verification_message

I was able to translate the other messages, but I couldn't find out how to translate this specific message. I followed this documentation (Localization string IDs)[https://docs.microsoft.com/en-ca/azure/active-directory-b2c/localization-string-ids] but still wasn't able to figure out how do to that.

Can you help me?

Thank you

Do not allow old passwords - How to?

Hello,

I saw that there is one sample that ask for the current password and the new password, so they can check if the new and old (current) are the same. However, how can I block the user to enter his X old passwords, especially without asking for the "Current password"?

Thank you

Avoid verification code emails when the user is not registered

Azure B2C is gives a false impression that the user is in the directory when they try to reset their password.

Following is steps in reset password:

  1. User clicks the Reset Password link
  2. B2C presents a page with “Email Address” field and says “Verification is necessary. Please click Send button.”
  3. User enters his email address and clicks “Send Verification Code”
  4. B2C sends the verification code this that email address (Even if no user is associated with that email address. This is where the user thinks he is registered with the system)
  5. Now the user enters the verification code he received and click “Verify Code”
  6. B2C validated the code and says “E-mail address verified. You can now continue” (This is the step where they become confident that they exist in the system)
  7. Now when the users click “Continue” they get the error “An account could not be found for the provided user ID.” As given in the screenshot.

Confirming an email that is not associated with a user completely confuses them.

i found this but not getting exactly how to use these policy along with this .

Assumes Windows as runtime OS

Windows should either be a documented requirement for the relevant samples (e.g. invite), or appropriate shell commands for Unix-like OSs should be provided as well.

e.g. for the invite sample, the code casts the certificates in a way that assumes Windows environments: https://stackoverflow.com/a/56979823

The provided commands for generating a certificate are also Windows-based, and the code assumes a Windows credential store.

Term of Service Custom Policy does not work for for Federated user

I’m trying to implement Term of Service custom policy with with HRD Custom Policy using this template: (Custom Policy Attached)
https://github.com/azure-ad-b2c/samples/tree/master/policies/terms-of-service

It work fine for local B2c users, but when I try with to log with 3rd part users like Azure AD or ADFS I got the following error:
Acceptance ToS is shown to user, but when user accept and click continue he got an error message like he hadn’t accepted the ToS.
ToS-ErrorMessage

This “Customizable Error Message” is the error message when the users try to continue without marking the checkbox.
This behavior only happen for 3rd party users and not local users.
Below it's my user Journey code - I'm using custom policy with both Home Realm Discovery and Term of Services:

>  <UserJourneys>
>   <!-- User Jorney SignIn With HRD -->
>     <UserJourney Id="SignIn">
>       <OrchestrationSteps>
>         <OrchestrationStep Order="1" Type="ClaimsExchange">
>           <ClaimsExchanges>
>             <ClaimsExchange Id="SigninEmailExchange" TechnicalProfileReferenceId="SelfAsserted-Signin-Email" />
>           </ClaimsExchanges>
>         </OrchestrationStep>
>         <OrchestrationStep Order="2" Type="ClaimsExchange">
>           <ClaimsExchanges>
>             <ClaimsExchange Id="ParseDomainHintLogic" TechnicalProfileReferenceId="HRDLogic" />
>           </ClaimsExchanges>
>         </OrchestrationStep>
>         <!-- If the domain_hint did not match any known domain, then redirect to a default local account sign in-->
>         <OrchestrationStep Order="3" Type="CombinedSignInAndSignUp" ContentDefinitionReferenceId="api.signuporsignin">
>           <Preconditions>
>             <Precondition Type="ClaimEquals" ExecuteActionsIf="true">
>               <Value>isKnownCustomer</Value>
>               <Value>True</Value>
>               <Action>SkipThisOrchestrationStep</Action>
>             </Precondition>
>           </Preconditions>
>           <ClaimsProviderSelections>
>             <ClaimsProviderSelection ValidationClaimsExchangeId="LocalAccountSigninEmailExchange" />
>             <!-- add password reset button to the user journey -->
>             <ClaimsProviderSelection TargetClaimsExchangeId="PasswordResetUsingEmailAddressExchange" />
>           </ClaimsProviderSelections>
>           <ClaimsExchanges>
>             <ClaimsExchange Id="LocalAccountSigninEmailExchange" TechnicalProfileReferenceId="SelfAsserted-LocalAccountSignin-Email" />
>           </ClaimsExchanges>
>         </OrchestrationStep>
>         <!-- dont run this step if the domain was known, or we have an objectid (local account sign in)-->
>         <OrchestrationStep Order="4" Type="ClaimsExchange">
>           <Preconditions>
>             <Precondition Type="ClaimsExist" ExecuteActionsIf="true">
>               <Value>objectId</Value>
>               <Action>SkipThisOrchestrationStep</Action>
>             </Precondition>
>             <Precondition Type="ClaimEquals" ExecuteActionsIf="true">
>               <Value>isKnownCustomer</Value>
>               <Value>True</Value>
>               <Action>SkipThisOrchestrationStep</Action>
>             </Precondition>
>           </Preconditions>
>           <ClaimsExchanges>
>             <ClaimsExchange Id="SignUpWithLogonEmailExchange" TechnicalProfileReferenceId="LocalAccountSignUpWithLogonEmail" />
>             <!-- call password reset technical profile to reset password -->
>             <ClaimsExchange Id="PasswordResetUsingEmailAddressExchange" TechnicalProfileReferenceId="LocalAccountDiscoveryUsingEmailAddress" />
>           </ClaimsExchanges>
>         </OrchestrationStep>
>         <!--Sample: Run this step only when user resets the password-->
>         <OrchestrationStep Order="5" Type="ClaimsExchange">
>           <!-- <Preconditions>
>             <Precondition Type="ClaimEquals" ExecuteActionsIf="false">
>               <Value>isPasswordResetFlow</Value>
>               <Value>True</Value>
>               <Action>SkipThisOrchestrationStep</Action>
>             </Precondition>
>           </Preconditions> -->
>           <Preconditions>
>             <Precondition Type="ClaimsExist" ExecuteActionsIf="false">
>               <Value>isPasswordResetFlow</Value>
>               <Action>SkipThisOrchestrationStep</Action>
>             </Precondition>
>           </Preconditions>          
>           <ClaimsExchanges>
>             <ClaimsExchange Id="NewCredentials" TechnicalProfileReferenceId="LocalAccountWritePasswordUsingObjectId" />
>           </ClaimsExchanges>
>         </OrchestrationStep>
>         <!-- If the domain matched any known domain, then this step will have a single IdP
>                     enabled due to each known IdP TP having an enablement flag via identityProviders claim -->
>         <OrchestrationStep Order="6" Type="ClaimsProviderSelection" ContentDefinitionReferenceId="api.idpselections">
>           <Preconditions>
>             <Precondition Type="ClaimEquals" ExecuteActionsIf="false">
>               <Value>isKnownCustomer</Value>
>               <Value>True</Value>
>               <Action>SkipThisOrchestrationStep</Action>
>             </Precondition>
>           </Preconditions>
>           <ClaimsProviderSelections>
>             <ClaimsProviderSelection TargetClaimsExchangeId="ADFS" />
>             <ClaimsProviderSelection TargetClaimsExchangeId="FOCAAAD" />
>           </ClaimsProviderSelections>
>         </OrchestrationStep>
>         <OrchestrationStep Order="7" Type="ClaimsExchange">
>           <Preconditions>
>             <Precondition Type="ClaimsExist" ExecuteActionsIf="true">
>               <Value>objectId</Value>
>               <Action>SkipThisOrchestrationStep</Action>
>             </Precondition>
>             <Precondition Type="ClaimEquals" ExecuteActionsIf="false">
>               <Value>isKnownCustomer</Value>
>               <Value>True</Value>
>               <Action>SkipThisOrchestrationStep</Action>
>             </Precondition>
>           </Preconditions>
>           <ClaimsExchanges>
>             <ClaimsExchange Id="ADFS" TechnicalProfileReferenceId="ADFS-SAML" />
>             <ClaimsExchange Id="FOCAAAD" TechnicalProfileReferenceId="AAD-OIDC" />
>           </ClaimsExchanges>
>         </OrchestrationStep>
>         <!-- For social IDP authentication, attempt to find the user account in the directory. -->
>         <OrchestrationStep Order="8" Type="ClaimsExchange">
>           <Preconditions>
>             <Precondition Type="ClaimEquals" ExecuteActionsIf="false">
>               <Value>isKnownCustomer</Value>
>               <Value>True</Value>
>               <Action>SkipThisOrchestrationStep</Action>
>             </Precondition>
>           </Preconditions>
>           <ClaimsExchanges>
>             <ClaimsExchange Id="AADUserReadUsingAlternativeSecurityId" TechnicalProfileReferenceId="AAD-UserReadUsingAlternativeSecurityId-NoError" />
>           </ClaimsExchanges>
>         </OrchestrationStep>
>         <!-- Still dont have objectId (social idp user that doesnt yet exist) - write the account -->
>         <OrchestrationStep Order="9" Type="ClaimsExchange">
>           <Preconditions>
>             <Precondition Type="ClaimsExist" ExecuteActionsIf="true">
>               <Value>objectId</Value>
>               <Action>SkipThisOrchestrationStep</Action>
>             </Precondition>
>           </Preconditions>
>           <ClaimsExchanges>
>             <ClaimsExchange Id="AADUserWrite" TechnicalProfileReferenceId="AAD-UserWriteUsingAlternativeSecurityId" />
>           </ClaimsExchanges>
>         </OrchestrationStep>
>         <OrchestrationStep Order="10" Type="ClaimsExchange">
> <!--           <Preconditions>
>             <Precondition Type="ClaimEquals" ExecuteActionsIf="true">
>               <Value>isKnownCustomer</Value>
>               <Value>True</Value>
>               <Action>SkipThisOrchestrationStep</Action>
>             </Precondition>
>           </Preconditions>
>  -->      
>           <ClaimsExchanges>
>             <ClaimsExchange Id="AADUserReadWithObjectId" TechnicalProfileReferenceId="AAD-UserReadUsingObjectId" />
>           </ClaimsExchanges>
>         </OrchestrationStep>
>         <!-- Add orchestrion step for TOU HERE before 11 -->
>         <!-- Start of Term of Service Acceptance Stesps -->
>         <!--Sample: Will redirect user to a TOS acceptance page if earlier claim transformation has determined required -->
>         <OrchestrationStep Order="11" Type="ClaimsExchange">
>           <Preconditions>
>             <Precondition Type="ClaimEquals" ExecuteActionsIf="true">
>               <Value>renewalTOSrequired</Value>
>               <Value>False</Value>
>               <Action>SkipThisOrchestrationStep</Action>
>             </Precondition>
>           </Preconditions>
>           <ClaimsExchanges>
>             <ClaimsExchange Id="RefreshTOS" TechnicalProfileReferenceId="SelfAsserted-RefreshTOS" />
>           </ClaimsExchanges>
>         </OrchestrationStep>
>         <!--Sample: This steps reads the directory again to refresh the variable of the TOS stored on the user object. If you do not plan
>         on sending the TOS version in a claim to the application, you can remove this step.-->
>         <OrchestrationStep Order="12" Type="ClaimsExchange">
>           <ClaimsExchanges>
>             <ClaimsExchange Id="AAD-ReadTOS" TechnicalProfileReferenceId="AAD-ReadTOS" />
>           </ClaimsExchanges>
>         </OrchestrationStep>
>         <!-- End of Term of Service Acceptance Stesps -->
>         <OrchestrationStep Order="13" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="JwtIssuer" />
>       </OrchestrationSteps>
>       <ClientDefinition ReferenceId="DefaultWeb" />
>     </UserJourney>
>   </UserJourneys>
>   <RelyingParty>
>     <DefaultUserJourney ReferenceId="SignIn" />
>     <!-- Enable Java Script Execution -->
>     <UserJourneyBehaviors>
>       <ScriptExecution>Allow</ScriptExecution>
>     </UserJourneyBehaviors>
>     <TechnicalProfile Id="PolicyProfile">
>       <DisplayName>PolicyProfile</DisplayName>
>       <Protocol Name="OpenIdConnect" />
>       <OutputClaims>
>         <OutputClaim ClaimTypeReferenceId="givenName" PartnerClaimType="firstname" />
>         <OutputClaim ClaimTypeReferenceId="surname" PartnerClaimType="surname" />
>         <OutputClaim ClaimTypeReferenceId="identityProvider" />
>         <OutputClaim ClaimTypeReferenceId="email" />
>         <OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="sub" />
>         <OutputClaim ClaimTypeReferenceId="identityProviders" />
>         <!--Sample: Additional claims are not required and were used for testing purposes only -->        
>         <!--Sample action Required: Remove after testing--><OutputClaim ClaimTypeReferenceId="extension_AgreedToTermsOfService" />
>         <!--Sample action Required: Remove after testing--><OutputClaim ClaimTypeReferenceId="policyTOSversion" />
>         <!--Sample action Required: Remove after testing--><OutputClaim ClaimTypeReferenceId="renewalTOSrequired" />
>       </OutputClaims>
>       <SubjectNamingInfo ClaimType="sub" />
>     </TechnicalProfile>
>   </RelyingParty>

"Forgot Password" link - Clarification

Hello!

I have my custom policy to sign up an user using local account and it works fine. I also have the link for the "Forgot password" and the Reset policy. If I test only the reset policy, it works. However, the forgot password link doesn't redirect the user to that policy.
How do I configure that? I read the documentation but it's not clear to me.

Thank you

Sign in with Apple out of Beta?

We've been waiting to implement Sign in with Apple through AADB2C until after it is out of beta. The sample related to this still has a disclaimer saying that it is in beta. However, I've been checking up on it periodically and I finally found this post that says it's now GA: Post GA Revisit of Sign in with Apple. Is it now safe to use the sample code in production? If so, you might want to review the sample to ensure it's up-to-date and remove the beta disclaimer.

Is there a way to find the MFA phone number for the local account in Azure AD B2C in signInName?

I would like to create the following flow.

  1. Regsiter B2C user with authentication phone number.(Before start this flow)
  2. Input signInName(User operation)
  3. Send verification code for using the authentication phone number(AAD process)
  4. The user input verification code(User operation)
  5. The user input new and same password for reset password(User operation)
  6. A application will get token

Do you have a sample that shows you how to create this flow?
Or can you tell me which samples I should choose to create this flow?

I think that this flow has some key points:

  • How AAD search the authentication phone number use signInName?
  • How move from step of 3. to step 4. ?

It would be very helpful if you could provide us with these samples.

About the "password-reset-only" sample: Need to add HTML content along with an <a> tag that can be rendered as HTML when claim is transformed

The sample for "password reset only" works great.
https://github.com/azure-ad-b2c/samples/tree/master/policies/password-reset-only

The TrustFrameworkExtensions file has the below content.

<ClaimsTransformations> <!--Demo: this claims transformation populates the userMessage with the text we want to show to the end user--> <ClaimsTransformation Id="GetPasswordResetUserMessage" TransformationMethod="CreateStringClaim"> <InputParameters> <InputParameter Id="value" DataType="string" Value="Your password has been successfully updated. To continue click on the sign-in link below." /> </InputParameters> <OutputClaims> <OutputClaim ClaimTypeReferenceId="userMessage" TransformationClaimType="createdClaim" /> </OutputClaims> </ClaimsTransformation> </ClaimsTransformations>

How can I add an Anchor tag here to show a link along with some friendly text. I tried to HTML Encode a string with an Anchor tag but it just renders as plain text without parsing the HTML parts.

Custom Email Verification - Creates User Twice

Hi,

I've tried implementing the custom email verification and it's all working up to the point where it tries to create the account. It tries to create the user object twice (see image below).

image

This obviously stops the user journey dead in its tracks. I should add I'm only using local accounts, no social integration.

Can anyone shed any light on why this is happening.

Cheers
Stokesy

Getting Error Code AADB2C90233 when attempting token validation (Invite Template)

I for the life of me cannot figure out where I have gone wrong here. I believe I have set everything up per the guidelines so far as appsettings.json and Custom Policies are concerned, however I still I get the following error when attempting token validation:

AADB2C90233 The provided id_token_hint parameter failed signature validation. Please provide another token and try again.

Any advice would be appreciated.

Correlation Failed with invite sample

I'm trying to implement the email invitation sample here:
https://github.com/azure-ad-b2c/samples/tree/master/policies/invite

I am able to get to the custom sign-up page successfully and it validates the token through my endpoint. But once I have signed up and it redirects back to my application I get a "Correlation Failed" error message.

I don't actually need to send the user an email as we have a process for that already. So I have also tried doing a normal challenge and manually setting the id_token_hint in the OnRedirectToIdentityProvider event.

Again I am able to get the custom sign up page and sign up. However I then get this error when it redirects back to my application:

IDX10501: Signature validation failed. Unable to match keys: kid: '[PII is hidden]', token: '[PII is hidden]'

I would prefer to use the latter solution but any help getting either to work would be appreciated

Custom policy, SignUpInvitation.xml, throwing `Object reference not set to an instance of an object` error

Greetings,

I'm trying to get the sample project, from this repo at the following URL, to work ...

https://github.com/azure-ad-b2c/samples/tree/master/policies/invite

The sample project includes a custom B2C policy, SignUpInvitation.xml, and a web project. It's my basic understanding that the included custom policy essentially requires a signed token in order to access the policy. The sample basically uses this as an "invitation" step to restrict access to the sign up policy. This is what I am after and so I do believe this sample is pointing me in the right direction. I'm just trying to get it to work, now.

My issue is that, after configuring what I believe to be all the required settings, I am getting an error from within the B2C policy - I think. So, I'll first walk through the steps of how I produce the error ...

producing the error

I run the provided web project and put in my email and then click invite. I receive the invitation email, which contains the link to the custom B2C policy - SignUpInvitation.xml. I click the link and am taken to the policy, but am given a page that says that an exception has occurred - "AADB2C: An exception has occurred."

Unable to find any additional debug info, we added our Application Insights configuration to the custom policy so that it logs output to App Insights. Now, within AI, I can see that the policy is producing the following error ...

  {
    ""Kind"": ""Action"",
    ""Content"": ""Web.TPEngine.StateMachineHandlers.GetRelyingPartyInputClaimsHandler""
  },
  {
    ""Kind"": ""FatalException"",
    ""Content"": {
      ""Time"": ""7:05 PM"",
      ""Exception"": {
        ""Kind"": ""Handled"",
        ""HResult"": ""80004003"",
        ""Message"": ""Object reference not set to an instance of an object."",
        ""Data"": {}
      }
    }
  }

So, there is a clear error, but still the message is a bit vague. And this is where I'm stuck. I'm unsure how to further debug this and pinpoint what is causing the reference error.

things I looked into

I have spent several days debugging this, and so through that course of debugging I've looked at basically every little bit of info that I could find regarding this. I'm just not well versed in the B2C policy XML scripts, and that seems to be a very deep and technical topic. It's a topic I am interested in learning, but just need some help on how to debug the scripts, etc.

One thing I did notice is that the Action in the above error mentions that it's getting the input claims. So, it looks to me like perhaps there is an issue in the policy, or my configuration, in getting the claims. So, I went up the "stack trace", in App Insights, for the above message and found the following action and result ...

  {
    ""Kind"": ""Predicate"",
    ""Content"": ""Web.TPEngine.StateMachineHandlers.InitiatingMessageValidationHandler""
  },
  {
    ""Kind"": ""HandlerResult"",
    ""Content"": {
      ""Result"": false,
      ""RecorderRecord"": {
        ""Values"": [
          {
            ""Key"": ""Validation"",
            ""Value"": {
              ""Values"": [
                {
                  ""Key"": ""SubmittedBy"",
                  ""Value"": ""Application""
                },
                {
                  ""Key"": ""ProtocolProviderType"",
                  ""Value"": ""OpenIdConnectProtocolProvider""
                }
              ]
            }
          }
        ]
      },
      ""Statebag"": {
        ""MSG(e4c7c6a9-8023-4cf7-9a34-c920e8325284)"": {
          ""c"": ""2020-03-20T19:05:48.1325292Z"",
          ""k"": ""MSG(e4c7c6a9-8023-4cf7-9a34-c920e8325284)"",
          ""v"": ""{\""TenantId\"":\""wibradixdev.onmicrosoft.com\"",\""PolicyId\"":\""B2C_1A_signup_invitation\"",\""RedirectUri\"":\""https://jwt.ms/\"",\""AdditionalParameters\"":{\""TEST\"":\""TEST\"",\""p\"":\""B2C_1A_signup_invitation\""},\""Nonce\"":\""0eefd73e94224dc69d8766dd219180e6\"",\""ClientId\"":\""30639331-3c2c-4ade-8c36-814dfe007170\"",\""ResponseType\"":\""id_token\"",\""ResponseRedirector\"":{\""URI\"":\""https://jwt.ms\"",\""D\"":false,\""WF\"":true},\""Scope\"":\""openid\"",\""AppModelVersion\"":1,\""ScopedProviders\"":[]}"",
          ""p"": true,
          ""t"": ""OAuth2""
        },
        ""CMESSAGE"": {
          ""c"": ""2020-03-20T19:05:48.1325292Z"",
          ""k"": ""CMESSAGE"",
          ""v"": ""e4c7c6a9-8023-4cf7-9a34-c920e8325284"",
          ""p"": true
        },
        ""IMESSAGE"": {
          ""c"": ""2020-03-20T19:05:48.1325292Z"",
          ""k"": ""IMESSAGE"",
          ""v"": ""e4c7c6a9-8023-4cf7-9a34-c920e8325284"",
          ""p"": true
        },
        ""ComplexItems"": ""_MachineEventQ, TCTX, ORCH_IDX, REPRM, IC""
      },
      ""PredicateResult"": ""True""
    }
  }

This action seems to be doing some type of validation, but I noticed that the result returns false, which usually means some sort of failure? I'm unsure in this case.

how do I proceed ?

Can you please help me out or point me in the right direction on how to figure this out? I deployed the sample web project to Azure, and you can access that here if you'd like to see what I'm seeing. If you have access to App Insights, you might be able to access my logs using the below information. The error in question occurred on 3/24/2020, 3:45:28.039 PM, with ikey and itemid 5d95a95b-6887-4798-a984-98a0a9d32d53 8a3a3e80-6de6-11ea-a0a3-ab73ec95556d.

App Insights Subscription Id: 265b7109-497d-42bc-8a20-fa6399a96a9c
App Insights Instrumentation Key: 5d95a95b-6887-4798-a984-98a0a9d32d53

Also, I attached the error message output here just in case you cannot see them in App Insights.

error_message.txt

Thank you!

Custom email verification: securing the API

In the custom email verification sample, it uses a POST to a rest API from the client-side javascript to send an email.

This seems ripe for abuse if left unsecured. How do you recommend this be secured, otherwise, should it be a server-side call?

/cc @yoelhor

Issues with signup-signin-with-phone-number

You need to use the SocialAndLocalAccountsWithMfa starter pack not the SocialAndLocalAccounts as per the Readme.

There is a missing:

ClaimsProviders
ClaimsProvider

in the xml.

When you run the sample, when it asks "Enter user name", you need to enter the phone number.

Invitation Sample - Can't upload self signed certificate to B2C policy key container

Hello,

I followed the instructions to use a self signed certificate and created one using powershell. In B2C I then created a policy key container (type RSA, usage Signature). But when I upload the PFX from my self signed certificate, I get this error: "The key 'B2C_1A_CustomTokenSigningKeyContainer' has failed to be created. The uploaded key is badly formatted. Reason: 'The key container has a different use than the new added key'."

Has anybody successfully followed the instructions for this sample? Any clues?

Thanks!

Custom email verification for Password Reset

I have tried the sample https://github.com/azure-ad-b2c/samples/tree/master/policies/custom-email-verifcation for reset password without success.

The SelfAsserted.html available fails to load the javascript, but that's a secondary problem that needs a separate issue.

The main issue is that the flow is not complete for PasswordReset. Below I have put the steps that I am trying to achieve with this solution, and where the problem sits:

First step
User provides email and click to send verification code, it reaches the API and sends the custom email successfully.

Second step
User grabs the code and put it on the B2C page. That gets validated successfully.
As soon as I hit the button to continue I get this error on screen: Claim not verified: [Email Address]
image

Third step
Provide new password and confirm new password.
This could not be validated.

Fourth step
Success message, and redirect to Login.
This could not be validated.

From what I can see within the schema, only the SignUp has Call to REST API verification, but not the PasswordReset.

Please can I get some guidance on that?

What approach would you recommend for doing the same on 'Cancel'?

Hi!
Following the same logic, I'd appreciate to know what the best approach for embedding a redirect from the password policy back to the sign-in policy is upon clicking the reset button.

Clearly, the intent is to no longer have to validate that obscure error code returned to the application, but rather keep the user's experience without leaving the page and redirecting him or her through a number of different URLs.

Worth pointing out is that the user might cancel inputing his/her e-mail address, cancel inputing the validation code received in via the password reset e-mail or cancel actually inputing a new password.
Taking the user back to the app means that any chance he/her did on the B2C ui in terms of the displayed language, is lost. Specifically, if during the B2C UI experience I'm changing the default display language to Spanish, once I go to the reset password experience (thanks to this sample), the language is maintained. But if I click cancel, I'll see the default language again, which is extremely inconvenient.

Is it posible to get the URL from "Register now!"

Hi!
Every time we arrive at Sigin page, the "Register now" generates a new URL with a token (that expires). I want to move the "Register Now" outside of Sign In page, we want to put the option to Sign Up on App front end, where the user can click for sign in or for sign up. Is it possible?

Empty policy with custom email verification with displayControl without givenName/surName

Hello,
I followed this tutorial with Microsoft B2C documentation. In my policies I didn't use claims firstName (givenName) and lastName (surName). I only used displayName. After uploading this policy to my b2c tenant and running policy I've got empty html page.

I tried to troubleshoot sign up policy with application insights but no errors showed. Weird is that after adding at least one of these claims policy "renders" correctly.

GivenName and Surname claims not extracted from Microsoft Account

If GivenName/Surname are selected in User attributes, then the user is asked to enter these explicitly, when instead they should be extracted from social providers.

If GivenName/Surname are not selected in User attributes, then they do not appear to the application in the list of claims, even when selected under “Application claims”.

As a result, to avoid the user having an extra step of re-entering first name and surname, this information must be extracted from the Name claim and parsed into GivenName and Surname. This workaround is not perfect as parsing a Name into GivenName and Surname is not guaranteed to work.

Is this a known issue in AD B2C?

Impersonation flow documentation

I've modified and uploaded the xml to the B2C tenant, enabled a user account to be able to impersonate, but the JWT token I get back can not be used on the API. I get 401.
Below are two tokens, one which works and other which does not (from impersonation flow).

Works:
{ "iss": "https://tenant.b2clogin.com/guid/v2.0/", "exp": 1580416129, "nbf": 1580412529, "aud": "guid1", "oid": "guid2", "sub": "guid2", "name": "John Doe", "given_name": "John", "family_name": "Does", "extension_UserRole": "Customer", "extension_UserType": "Customer", "impersonatedUser": "[email protected]", "tfp": "B2C_1A_Impersonation", "nonce": "defaultNonce", "scp": "read", "azp": "guid3", "ver": "1.0", "iat": 1580412529 }

Does not work (code 401):
{ "iss": "https://tenant.b2clogin.com/guid/v2.0/", "exp": 1580421015, "nbf": 1580417415, "aud": "guid1", "oid": "guid2", "sub": "guid2", "name": "John Doe", "given_name": "John", "family_name": "Does", "extension_UserRole": "Customer", "extension_UserType": "Customer", "impersonatedUser": "[email protected]", "nonce": "defaultNonce", "scp": "read user_impersonation", "azp": "guid3", "ver": "1.0", "iat": 1580417415 }

Any hint would be appreciated.

Is there any method to get MAC address of the user's system using custom policies?

Hi,

I want to uniquely identify the user's machine other than IP addresses and want to store it into the claims as well. Is there any method to get MAC address of the user's machine using the custom policies flow or is there any other way to uniquely identify the user's machine. The reason behind why I don't want to go with the IP address is that this approach cannot uniquely identify the user's machine if all the machines are on the same network let's say on an organisational network. In that case it will give me the public IP address which I don't want because public IP address will be same for all the machines inside that network.

These examples are old and out of date

These examples need updated. You dont even support the framework versions many of them are written for such as the invite flow being setup for dotnet core 2.2.

The related notes are also all out of date which make trying to follow these examples very difficult.

ClaimType "userId" missing Error on username-signup-or-signin

Hi, following the instructions at [https://github.com/azure-ad-b2c/samples/tree/master/policies/username-signup-or-signin], I get an error when uploading the Username_TrustFrameworkExtensions.xml

Validation failed: 1 validation error(s) found in policy "B2C_1A_USERNAME_TRUSTFRAMEWORKEXTENSIONS" of tenant "tenantname.onmicrosoft.com".Policy "B2C_1A_Username_TrustFrameworkExtensions" of tenant "tenantname.onmicrosoft.com" makes a reference to ClaimType with id "userId" but neither the policy nor any of its base policies contain such an element.

Example is not working link-local-account-with-federated-account

Hi,
The example is not working. Please fix it.

  • missing TechnicalProfile Id="Facebook-OAUTH" on the TrustFrameworkBase.xml.
  • error on the line OutputClaim ClaimTypeReferenceId="newUser" DefaultValue="true" on the TechnicalProfile Id="AAD-MergeAccount" on the the TrustFrameworkExtensions.xml

There is also not enough documentation of the steps and changes to be made in the files for the example to work. please document it further.

Thanks

Custom email verification - DisplayControls policy failure

Nothing fancy. Simply changed needed fields and applied templates to blank B2C directory with no users. Account creation comes back with the error message:
"A user with the specified ID already exists. Please choose a different one."
When I go check the directory I see that even though the error was thrown, it was indeed created there. I try to then log in with the user name and password I put in registration screens and receive:
"Invalid username or password."
I am not sure what is happening as I have done zero customizations. I thought the example on Github would work out of the box :-(

Do not require auth when editing the profile

I have the following user journey

<UserJourney Id="ProfileEdit">
  <OrchestrationSteps>

    <OrchestrationStep Order="1" Type="ClaimsProviderSelection" ContentDefinitionReferenceId="api.idpselections">
      <ClaimsProviderSelections>
        <ClaimsProviderSelection TargetClaimsExchangeId="FacebookExchange" />
        <ClaimsProviderSelection TargetClaimsExchangeId="GoogleExchange" />
        <ClaimsProviderSelection TargetClaimsExchangeId="LocalAccountSigninEmailExchange" />
      </ClaimsProviderSelections>
    </OrchestrationStep>
    <OrchestrationStep Order="2" Type="ClaimsExchange">
      <ClaimsExchanges>
        <ClaimsExchange Id="FacebookExchange" TechnicalProfileReferenceId="Facebook-OAUTH" />
        <ClaimsExchange Id="GoogleExchange" TechnicalProfileReferenceId="Google-OAUTH" />
        <ClaimsExchange Id="LocalAccountSigninEmailExchange" TechnicalProfileReferenceId="SelfAsserted-LocalAccountSignin-Email" />
      </ClaimsExchanges>
    </OrchestrationStep>
    <OrchestrationStep Order="3" Type="ClaimsExchange">
      <Preconditions>
        <Precondition Type="ClaimEquals" ExecuteActionsIf="true">
          <Value>authenticationSource</Value>
          <Value>localAccountAuthentication</Value>
          <Action>SkipThisOrchestrationStep</Action>
        </Precondition>
      </Preconditions>
      <ClaimsExchanges>
        <ClaimsExchange Id="AADUserRead" TechnicalProfileReferenceId="AAD-UserReadUsingAlternativeSecurityId" />
      </ClaimsExchanges>
    </OrchestrationStep>
    <OrchestrationStep Order="4" Type="ClaimsExchange">
      <Preconditions>
        <Precondition Type="ClaimEquals" ExecuteActionsIf="true">
          <Value>authenticationSource</Value>
          <Value>socialIdpAuthentication</Value>
          <Action>SkipThisOrchestrationStep</Action>
        </Precondition>
      </Preconditions>
      <ClaimsExchanges>
        <ClaimsExchange Id="AADUserReadWithObjectId" TechnicalProfileReferenceId="AAD-UserReadUsingObjectId" />
      </ClaimsExchanges>
    </OrchestrationStep>

    <OrchestrationStep Order="5" Type="ClaimsExchange">
      <ClaimsExchanges>
        <ClaimsExchange Id="B2CUserProfileUpdateExchange" TechnicalProfileReferenceId="SelfAsserted-ProfileUpdate" />
      </ClaimsExchanges>
    </OrchestrationStep>
    <OrchestrationStep Order="6" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="JwtIssuer" />

  </OrchestrationSteps>
  <ClientDefinition ReferenceId="DefaultWeb" />
</UserJourney>

It works, but it first asks the user to authenticate then the user can edit their profile.

What I'm trying to do now is to remove the authentication step so the user goes directly to the edit profile form. I'm playing removing the firsts OrchestrationStep but it is not working. I've also checked all the examples in this repository but none is about editing the profile. So, I have a question:

Is it possible to remove the authentication step when editing the profile? If yes, can someone provide an example?

Parsed and Prompted Home Realm Discovery?

I took the default home realm discovery policy and ran with it which is using domain_hint to select IdPs. This works pretty well for a case of serving many customers that have different domains (or lists of IdPs). I am wondering though if it possible to extend that paradigm to prompt for a domain if the domain_hint is not passed? I have tried a couple times with self-asserted claim but don't seem to be able to get it working together. Ideally, the same logic of matching to a knownDomain could be used whether domain_hint passed or prompted.

Article about features that are deprecated or recommended in policies?

I've noticed that the schema for B2C supports some things that aren't used in any of the samples. It looks like none of the examples use user journey's that contain sub-journeys or input validations instead of predicate validations. There are places where the docs and scenario examples seem to favor one thing over another and it would be good to document that so that people don't take dependencies on something that you plan to deprecate.

Question about example "B2C IEF Custom Policy - A Sign In policy with Home Realm Discovery"

Hi

The flow for this example"home-realm-discovery-modern" :

  1. One screen to enter the email:
    image
  2. IF the email domain is not on the list of known external providers, then is a LocalAccount, we will prompt another screen:
    image
  3. IF the email domain is ON the list of known external providers, then call the other provider:
    image

One Question:
Is it possible to have only one screen for entering the information for the login (username, and password), and from that screen continues the flow either for the login for a local account (login-NonInteractive) or call the other Provider (like AAD or Microsoft)?
Only one screen like this one:
image

I tried to implement it, these are the steps that I followed:

  1. This step to get the email and the password from the user ( i am saving the password on plain text on other claim to be able to use it as OutputClaim)
    OrchestrationStep Order="1" Type="CombinedSignInAndSignUp" ContentDefinitionReferenceId="api.localaccountsignin">
    ClaimsProviderSelections>
    ClaimsProviderSelection ValidationClaimsExchangeId="LocalAccountSigninEmailExchange2" />
    ClaimsProviderSelections>
    ClaimsExchanges>
    ClaimsExchange Id="LocalAccountSigninEmailExchange2" TechnicalProfileReferenceId="SelfAsserted-Signin-Email"

  2. to be able to pass the claimprividerSelection:
    OrchestrationStep Order="3" Type="ClaimsProviderSelection" ContentDefinitionReferenceId="api.idpselections">
    Preconditions>
    Precondition Type="ClaimEquals" ExecuteActionsIf="false">
    Value>isKnownCustomer
    Value>False
    Action>SkipThisOrchestrationStep
    Precondition>
    Preconditions>
    ClaimsProviderSelections>
    ClaimsProviderSelection TargetClaimsExchangeId="LocalAccountSigninEmailExchange" />
    ClaimsProviderSelections>
    OrchestrationStep>
  3. Call login-NonInteractive directly from the OrchestrationStep, passing the password and the email.
    OrchestrationStep Order="4" Type="ClaimsExchange">
    Preconditions>
    Precondition Type="ClaimEquals" ExecuteActionsIf="false">
    Value>isKnownCustomer
    Value>False
    Action>SkipThisOrchestrationStep
    Precondition>
    Preconditions>
    ClaimsExchanges>
    ClaimsExchange Id="LocalAccountSigninEmailExchange" TechnicalProfileReferenceId="login-NonInteractive" />
    ClaimsExchanges>
    OrchestrationStep>
    4)The other steps are exactly the same as the example for the External Provider.

The call for the External provider is working perfectly on my example BUT, if I try to login with a local account, I have an error on step number 3 (login-NonInteractive) :
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.