Azure AD Out-of-the-box Authentication, ID Token & Access Token

Kevin Azure 141 Reputation points
2020-01-17T15:47:54.98+00:00

Hi Experts,

I am using Azure AD Out-of-the-box Authentication. Login is successful.
https://working-angular-webapi.azurewebsites.net/.

Email: aadtester@jeanpaulvagmail.onmicrosoft.com Password: authentication1!

ID Token also found through URL:
https://working-angular-webapi.azurewebsites.net/.auth/me

However I need to get a Graph API Token also on behalf of User. I added the permission with "delegated" on Directory.Read.All for the AAD App Registration.

So using ID Token can I get a Silent Access Token from client-side or server-side?
(without Login prompt again)

What will be the code look like?

Thanks in advance.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,436 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Saurabh Sharma 23,671 Reputation points Microsoft Employee
    2020-01-17T22:29:56.227+00:00

    In order to use Microsoft Graph your application needs to get an access token from the Microsoft Identity platform and attach the same token to the Graph request. This authentication flow is described here.
    Also, for an Angular sample you can refer to the documentation.