1
votes

I want to make multi-tenant application on https://apps.dev.microsoft.com. This work fine with single tenant but My process for making multi-tenant app ---- LogIn with Other Tenant and appear consent window and got code successfully which code I passed for getting token

I am getting token from here

Token successfully generated: Call graph API for office 365 But error genrate -- "We do not recognize this tenant ID 21f3be0a-xx-4b7f-ab05-xxxxx6. Please double-check the tenant ID and try again.

I am geeting token from ]2 When access data for office 365 report why this tenant id not recognized error raised? Need to edit in manifest ? My App on https://apps.dev.microsoft.com. Have Three 3 Microsoft Graph Permissions Delegated Permissions - user.read , Reports.Read.All (Admin Only)

2
you should probably remove sensitive data from the screenshot...4c74356b41

2 Answers

1
votes

You can check whether a tenant is valid or invalid using the Well Known OpenId Configuration endpoint:

https://login.microsoftonline.com/<tenant>/.well-known/openid-configuration

Doing this for your tenant id gives this result:

https://login.microsoftonline.com/21f3be0a-713c-4b7f-ab75-3cc5ca25846/.well-known/openid-configuration

error: "invalid_tenant"

error_description: "AADSTS90002: Tenant 21f3be0a-713c-4b7f-ab75-3cc5ca25846 not found. This may happen if there are no active subscriptions for the tenant. Check with your subscription administrator.\r\nTrace ID: bdd561b1-bc36-44ce-b3ab-33e53fda0100\r\nCorrelation ID: c6ce0c0d-6550-4f5f-a398-a82f085e28c1\r\nTimestamp: 2017-11-01 17:38:31Z"

So simply stated, the tenant id that you are using is not valid for the AAD Worldwide endpoint.

Is it possible you are getting a token for a different instance of AAD? Can you share the contents of your Access Token (removing any sensitive details)?

0
votes
   I did some mistakes thats why this Error raised then need not do anything becoz this Portal app by default Multitenant and send request to common platform ..
    Login with other tenant get code

    https://login.microsoftonline.com/common/oauth2/authorize?
    client_id=XXXXX-XXX
    &response_type=code
    &redirect_uri=http://localhost:49876    
    &response_mode=query
    &scope=Reports.Read.All 
    &prompt=consent
    &state=12345


    then get token 
    https://login.microsoftonline.com/common/oauth2/token
    client_id =XXX
    scope =
    code= which you get
    grant_type=
    client_secret=

    after get token use for Graph API & get office365 data for -https://graph.microsoft.com/beta/reports/getMailboxUsageMailboxCounts(period='D7')