I use OpenId Authentication combined with MS Identity Web within a .NET6 Razorpage Project.
I can log in with an account with Global Admin and "TENANT.onmicrosoft.com" and am redirected to /Index. As soon as I want to log in with a "mail" account without role, I get the following error message after the "Do you want to log in permanently?":
Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectProtocolException: Message contains error: 'invalid_request', error_description: 'AADSTS500208: The domain is not a valid login domain for the account type. Trace ID: d1fa4b6a-f9d2-4b89-89f6-1b25e5ac0600 Correlation ID: ef98b16d-b46e-4062-bacc-9bd6b136ab24 Timestamp: 2024-01-08 10:29:19Z', error_uri: 'error_uri is null'.
This error occurs on the /signin-oidc page.
I have configured the application for this as follows:
Web redirect URI's:
https://localhost:xxxx/signin-oidc
https://localhost:xxxx/Index
URL for front channel logout:
https://localhost:xxxx/signout-oidc
✔️ Access tokens (used for implicit flows)
✔️ ID token (used for implicit and hybrid flows)
✔️ Accounts in any organizational directory (any Microsoft Entra ID client - multi-tenant capable)
In addition, a user flow with email one-time passcode and Google, Facebook runs behind it.
If a user logs in with Global Admin with the following criteria:
Identities ExternalAzureAD
User type Member
it works.
As soon as Global Admin is revoked, the error shown above appears again. So it seems to be a rights problem?
Greetings.