Search code examples
c#azureazure-active-directoryazure-ad-graph-apimicrosoft-account

How to determine if an email address is a Microsoft 'Work or School' account or a Microsoft Account


I would like to authenticate against both Microsoft accounts and 'Work or School' accounts in a Azure multi-tenant environment. Each authentication type requires different requests. If I try to login as a Microsoft account against the 'work or school' request the login will fail at the Microsoft login and not return to my application.

Is there a way to query if a given email address is a 'Work or School' account against the Microsoft graph API?


Solution

  • If you use the REST api, it should automatically handle the two types of accounts.

    However, it is in preview and might have restrictions or issues.

    Here is a guide for using the REST api: http://graph.microsoft.io/en-us/docs/platform/rest

    But be sure to check if that is acceptable to work with given the restrictions: https://azure.microsoft.com/en-us/documentation/articles/active-directory-v2-limitations/