unable to get the logged in user access token using msal PublicClientApplicationBuilder.AcquireTokenSilent

Vivek Khadse 0 Reputation points
2023-02-24T06:21:57.7033333+00:00

hello...

while implementing the send email method using graph API (msal) package of .Net core ,

i am facing the issue that i could not getting the logged users access token even if user is logged IN in browser i am using swagger to test an API's

i try all the solutions from the internet source but not getting the exact correct solution ..

i try to change the configuration of azure portal also, but still getting the same..

and if i use "AcquireTokenInteractive" method it prompts the window for logged in and i get authorize and then it says :-

AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret'.

can you please guide me to do this implementation..

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,806 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,336 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 45,921 Reputation points
    2023-02-24T07:39:49.7233333+00:00

    Hi @Vivek Khadse

    Public client apps don't need to provide 'client_assertion' or 'client_secret', make sure your app has enabled public client flows.

    Go to Azure AD >App registrations > find your app > Authentication.

    23

    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.

    1 person found this answer helpful.

Your answer

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