question

CarlosBarragan-5927 avatar image
0 Votes"
CarlosBarragan-5927 asked amanpreetsingh-msft answered

Custom Policy for username login

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.

azure-ad-b2c
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

amanpreetsingh-msft avatar image
0 Votes"
amanpreetsingh-msft answered

Hello @CarlosBarragan-5927 · 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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

oscarmh avatar image
1 Vote"
oscarmh answered

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


image.png (44.4 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.