I have Auth0 configured with Social Connections > Microsoft Account.
This is linked through Client ID/secret to a Microsoft Azure Active Directory tenant in my Microsoft organisation, with an App Registration set to allow:
Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox) All users with a work or school, or personal Microsoft account can use your application or API. This includes Office 365 subscribers.
When I log in through my app, I can authenticate successfully using my personal account eg. [email protected]
However, when I try to authenticate with my work account [email protected], which is managed with an Azure Active Directory, it fails with
"That Microsoft account doesn’t exist. Enter a different account or get a new one.":
I thought given the Microsoft settings it would allow it connect.
How can I make Auth0 allow Microsoft authentication with other company's existing Azure Active Directory?
Also - can I configure it to limit that feature to specific companies AAD eg. those I have specifically nominated?
Is there a way to configure this without having to upgrade to Auth0 Enterprise?
Assuming you want to use multi-tenant app to allow users from different company to sign in your application with their work account. Let's assume you create an Azure AD application in your tenant(tenantA).
Then in your app, you may set the TenantId as the
tenant id
so that even you created a multi-tenant app, you will only allow users in your tenant to sign in. And the sign in request may look likehttps://login.microsoftonline.com/{tenantA_tenant_id}/oauth2/v2.0/authorize?
, with this link, you will be able to use account like[email protected]
to sign in, you can also use personal account which is invites to tenantA as a guest to sign in your account.If you want users in tenantB to sign in your app with account like
[email protected]
, then you must set the TenantId in your app ascommon
which will make the auth request look likehttps://login.microsoftonline.com/common/oauth2/v2.0/authorize?
Then when sign in the application created by tenantA with account in tenantB, you may see screenshot below. After consenting it, [email protected] can sign in this application.