Custom Policy for username login

Carlos Barragan 26 Reputation points
2021-01-15T19:55:10.807+00:00

How can I create a custom Policy to login with username in Azure B2C. It's asking for an email address but I want to use only a local username.

Microsoft Security | Microsoft Entra | Microsoft Entra External ID
0 comments No comments
{count} votes

Accepted answer
  1. AmanpreetSingh-MSFT 56,876 Reputation points Moderator
    2021-01-18T11:47:20.82+00:00

    Hello @Carlos Barragan · Thank you for reaching out.

    For username based signup and sign in journey in custom policy, please refer to the custom policy sample below:

    https://github.com/azure-ad-b2c/samples/tree/master/policies/username-signup-or-signin/policy

    -----------------------------------------------------------------------------------------------------------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Oscar Maqueda 611 Reputation points Microsoft Employee
    2021-01-15T20:47:55.26+00:00

    Have you tried this

    Azure AD B2C can be use email OR localAccount for authentication. You need to set the "identity providers" to localAccounts: enter image description here

    57285-image.png

    Note: in odrer to create local accounts you need to set "creationType": "LocalAccount" in the JSON to create local account users.

    Best regards

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.