How do i get an Identity Token from Azure Active Directory

Paul Viet Truong 21 Reputation points
2022-08-18T21:28:20.487+00:00

I am doing sign in for my application using Active Directory. I can get an access token for the application, however the access token is a Graph API access token which you can't validate and verify on own. Everything I am reading online says that the access token is nonce and requires special processing and doesn't need validating; calling a graph api call will have it go through validation and it's verified on call. It says I should be using and identity token to verify the user, but how do i get the identity token? It says in the documentation that it comes back with the accesss token, but I'm not seeing this in the request response. I'm using msal and doing result = app.acquire_token_by_username_password({username}, {password}, scopes=["User.ReadBasic.All"]). I get back the access token but I dont see any id token. I see alot documents saying to use the id token to verify the user however nothing that says how to get the id token.

Thanks In Advance,
Paul

Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,678 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,854 questions
{count} votes

Accepted answer
  1. Vasil Michev 97,076 Reputation points MVP
    2022-08-19T06:43:40.663+00:00

    You need to include the "openid" scope in the token request in order to obtain an ID token.


0 additional answers

Sort by: Most helpful