Unable to login with Recommended sign in user flow

Maxim Tihobrazov 106 Reputation points
2020-09-18T09:37:20.177+00:00

I am using Azure AD B2C and create there a new sign in user flow

If I choose "Standard" flow, then try to test it with "Run user flow" in portal, it works fine (I enter UPN as login here),

but with choosing "Recommended" I can not login with the error "The username you have provided is not valid. It must begin with an alphabetical character or number, and can only contain alphanumeric characters and the following symbols: _ -", so full UPN with the form user@ssss .com can not be used, trying to enter login without @ssss .com ends up with the error "We can't seem to find your account"

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,561 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Jas Suri 91 Reputation points Microsoft Employee
    2020-10-08T09:28:44.74+00:00

    You can use Custom Policy Username sample here that will support both Username and Email in a Username style policy (like User Flow).
    https://github.com/azure-ad-b2c/samples/tree/master/policies/username-signup-or-signin

    The Custom Policy allows you to adjust the regular expression used to validate the "username" field, such that it can support the '@' symbol, or any other characters you expect.

    In User Flow, it has been restricted to explicitly Email=email, and Username=username (ie not an email).

    1 person found this answer helpful.
    0 comments No comments

  2. JamesTran-MSFT 36,376 Reputation points Microsoft Employee
    2020-09-25T21:40:51.64+00:00

    @Maxim Tihobrazov and @Nick Rubino
    Thank you both for the details and screenshots, I reproduced your issue and will post my findings below.

    Findings:
    Working with my team, we found that your "Local Account" configuration might be set to Username, rather than Email.
    28397-repro.jpg

    Next Steps:
    In order to resolve this issue we need to change your configuration from username to email.

    1- Navigate to where your AzureAD B2C overview page -> Select Identity Providers -> Select Local Account -> Change from Username to Email
    28423-localaccconfig.jpg

    2- Navigate to your User flows, specifically your "recommended sign-in" flow -> Select Identity Providers -> Select the box next to Local Account and save.
    28472-b2cconfig.jpg

    3- Re-run the flow and sign in using your email address or UPN.

    If you're still experiencing issues with this, please let me know.
    Thank you for your time and patience throughout this issue.