Access token is always null in azure ad B2C signin response

Priya Shanmugam 1 Reputation point
2022-07-17T04:46:42.517+00:00

Hi all,
I have setup my webapp and b2c tenant following the article https://learn.microsoft.com/en-us/azure/active-directory-b2c/quickstart-web-app-dotnet

On sign in, I always get only id token and access token is always null. I tried passing "openid offline_access" along with my client id in the scope.

I have chosen both options of access token and id token in my tenant.

Can you advise on what changes to be made to get the access token.

Thanks,
Priya

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,507 questions
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,634 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,381 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. 2022-07-17T20:35:57.09+00:00

    Hello @Priya Shanmugam , the refered sample requests and obtains both an id_token and an authorization code. The latter will be exchanged by an access token in a separate call in the StartupAuth.cs.OnAuthorizationCodeReceived method.

    Let us know if you need additional assistance. If the answer was helpful, please accept it and complete the quality survey so that others can find a solution.

    0 comments No comments