简体   繁体   中英

having an issue with Azure AD B2C sign in/set up

I am trying out Azure AD B2C by following the docs here: https://learn.microsoft.com/en-gb/azure/active-directory/develop/tutorial-v2-asp-webapp

I have created an ADB2C tenant directory, and I have created the test application. The sign in link seems to be fine. Then I add test users to the AD directly because I want to test signing in. When testing, I usually create email addresses in the following format: email+ADtest@mydomain.org. I add an user with such an email, a password, etc. Then from within my test application sign in screen, I try to sign in, but I always get the error the username is not recognized.

Next, I add another user to the AD directly: my personal email account, with a password. Now this time when I try to sign in with my app, it recognizes that email address as an account already registered with microsoft.com and tries to authenticate me that way. But this is not what I want. I only want the email accounts whether they be user@microsoftonline.com or user@gmail.com to authenticate against the AD users I have setup with their passwords. I don't want microsoft to recognize them against their own database of users. How can I set this up?

Azure B2C and normal AAD are different.

See OAuth 2.0 authorization code flow in Azure Active Directory B2C and Normal AAD OAuth 2.0 authorization code flow .

We can find that the B2C authorize endpoint is https://{tenant}.b2clogin.com/{tenant}.onmicrosoft.com/{policy}/oauth2/v2.0/authorize while AAD authorize endpoint is https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize .

We need to specify the B2C sign in policy when we integrate the B2C authentication.

So the document you are following doesn't apply to B2C scene. Please refer to Quickstart: Set up sign in for an ASP.NET application using Azure Active Directory B2C .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM