Share via

Accessing other app registries with an Azure Access Token

Gürkan Kuluç (Entek) 20 Reputation points
2023-12-12T09:51:22.9233333+00:00

Hello, I have a .net API application integrated with Azure App Register and a mobile application that uses these APIs by purchasing tokens as login via Azure App Register. Since these 2 applications use the same app register, I do not have a problem with token recognition. However, although I have graph API permissions in the register, I cannot make requests to the graph API. I get the unauthorized reply. When you type "https://graph.microsoft.com/.default" in the scope parameter, you get graph access, but this time I get an invalid audience error in my own API application. I have more applications in my app registry. Can I access other applications with the token I get from the register where the mobile is logged in, or can I at least use the graph API while accessing my own API application?

Ekran görüntüsü 2023-12-12 124342 kopya

Ekran görüntüsü 2023-12-12 124900

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Answer accepted by question author
  1. CarlZhao-MSFT 46,431 Reputation points
    2023-12-15T07:57:40.6966667+00:00

    Hi @Gürkan Kuluç (Entek)

    Do not apply your custom Web API's access token to the graph API, as these are two different types of APIs and you should request a dedicated token for the graph API.

    Access tokens are issued based on the API audience, and when you use an access token with an audience for the Web API to call the graph API, it will report an “invalid audience” error.

    18

    By the way, one token can only be used to call one type of API, not other types of APIs.

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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