aspnet-connect-sample icon indicating copy to clipboard operation
aspnet-connect-sample copied to clipboard

Users without organization email are rejected on sign in.

Open MrCharli3 opened this issue 9 years ago • 8 comments

I am trying to create a B2B Management portal. But for some reason this sample does not let me sign in with any email adress. For example [email protected] does not work. Following error after sign-in:

AADSTS50020: User account '[email protected]' from external identity provider 'live.com' is not supported for api version '2.0'. Microsoft account pass-thru users and guests are not supported by the tenant-independent endpoint. Trace ID: 2ad8bee0-d00a-4896-9907-b5271a113300 Correlation ID: 0ea84617-4aa1-4830-859f-6f418252765e Timestamp: 2017-10-03 15:35:22Z

I changed the authority to only allow users from my tenant (requirement): https://login.microsoftonline.com/tenant.onmicrosoft.com/v2.0

This is the only change I made. Using "common" will not work since that lets anyone in.

MrCharli3 avatar Oct 03 '17 15:10 MrCharli3

If you switch to the tenant-specific authority, then only accounts from that tenant domain will be allowed to sign in.

jamescro avatar Oct 03 '17 16:10 jamescro

@jamescro Thanks. So I cannot use it for a B2B scenario where there are guest users in that tenant? They do not count as "part of the tenant"?

because the [email protected] I am talking about above is in the tenant. It's been invited as a "guest user", i.e a B2B user.

MrCharli3 avatar Oct 03 '17 16:10 MrCharli3

Thanks for the extra information. I'll investigate and report back after I know some more about your specific use case.

jamescro avatar Oct 03 '17 16:10 jamescro

Also, since this isn't directly related to the sample, could you post this question to Stack Overflow, and tag the question with [microsoftgraph]?

jamescro avatar Oct 03 '17 20:10 jamescro

@jamescro Done. Hopefully someone can figure this out. Really weird if you can't use new tech (B2B) with other new tech. Don't want to use out-dated ADAL and AAD Graph

MrCharli3 avatar Oct 03 '17 20:10 MrCharli3

Thanks very much. Could you post the SO URL here so that I can track it as well?

jamescro avatar Oct 03 '17 21:10 jamescro

https://stackoverflow.com/questions/46553313/b2b-users-cannot-sign-in-to-tenant-using-v2-0-endpoint-msal-auth-flow

MrCharli3 avatar Oct 03 '17 21:10 MrCharli3

Closing since it looks like this has been resolved on SO.

jamescro avatar Oct 05 '17 17:10 jamescro