How to get access token for Multi tenant applications

chawal-7106 20 Reputation points
2024-02-16T12:04:26.6966667+00:00

Hi , In Entra, I registered an application where the only supported account type is accounts in this organizational directory .This application allows me to obtain an access token.I want to make this application available to people outside of the organization. I am familiar with the process of converting a single tenant into a multi-tenant application. My question is : How can I get an access token for multitenants?

Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

Accepted answer
  1. Navya 20,100 Reputation points Microsoft External Staff Moderator
    2024-02-16T13:17:30.6866667+00:00

    Hi @chawal

    Thank you for posting this in Microsoft Q&A.

    I understand you want to get access token for multi-tenant application.

    To get access token for multi-tenant application, you have to use below endpoint.

    User's image

    I'm obtain an access token using an authorization code flow. First, we need to Request an authorization code.

    https://login.microsoftonline.com/common/oauth2/v2.0/authorize 
    client_id=3b04e940-05a2-4771-93f3-XXX
    &response_type=code
    &redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient
    &response_mode=query
    &scope=user.read
    
    

    Once the user authenticates and grants consent, the Microsoft identity platform returns a code.

    Request an access token.

    https://login.microsoftonline.com/<issuer>/oauth2/v2.0/token 
    client_id= 3b04e940-05a2-4771-93f3-XXX
    &scope=user.read
    &code= authorization code which get in previous step 
    &redirect_uri= https://login.microsoftonline.com/common/oauth2/nativeclient
    &grant_type=authorization_code
    

    For your reference: https://learn.microsoft.com/en-us/entra/identity-platform/v2-protocols#endpoints

    Hope this helps. Do let us know if you any further queries.

    Thanks,

    Navya.

    Please remember to "Accept Answer" if answer helped you.This will help us as well as others in the community who might be researching similar questions.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.