question

KevinAzure avatar image
0 Votes"
KevinAzure asked ·

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

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.

azure-active-directory
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

SaurabhSharma-msft avatar image
0 Votes"
SaurabhSharma-msft answered ·

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.

· 1 · Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Please let me know if you find above reply useful. If yes, do click on 'Mark as answer' link in above reply. This will help other community members facing similar query to refer to this solution. Thanks.

0 Votes 0 · ·