Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Why are there multiple api endpoints for azure oauth?

What is the difference between:

  • https://login.microsoftonline.com/common/oauth2/v2.0/token
  • https://login.microsoftonline.com/organizations/oauth2/v2.0/token
  • https://login.microsoftonline.com/{Directory ID}/oauth2/v2.0/token

Using common (the first endpoint) seems to work fine for generating my tokens?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

When you register an application in Azure AD, you are asked to choose the account types that can use the application.

enter image description here

The endpoints essentially corresponds to these.

  • https://login.microsoftonline.com/common/oauth2/v2.0/token: You can use common endpoint to authenticate/authorize any account (Personal Microsoft Account or Work/School Account).
  • https://login.microsoftonline.com/organizations/oauth2/v2.0/token: When you use organizations endpoint, only Work/School Account can be authenticated. Personal Microsoft Accounts cannot be authenticated/authorized.
  • https://login.microsoftonline.com/{Directory ID}/oauth2/v2.0/token: When you specify the directory id (also known as Tenant Id) in the endpoint, only Work/School Accounts in that tenant can be authenticated/authorized. Personal Microsoft Accounts and Work/School Accounts in other tenants cannot be authenticated/authorized unless they are added to the tenant as guest users.
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading