Unable to use Microsft Graph API in c#

Navneet 1 Reputation point
2021-06-10T10:33:20.903+00:00

I have used Microsoft Graph API for getting azure ad user list but getting error when getting user list as below.

A configuration issue is preventing authentication - check the error message from the server for details. You can modify the configuration in the application registration portal. See https://aka.ms/msal-net-invalid-client for details. Original exception: AADSTS7000215: Invalid client secret is provided.

But i have recreate client secret this is not worked i have used client secret which is used for login this is also not worked where i am wrong?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,776 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,849 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Siva-kumar-selvaraj 15,681 Reputation points
    2021-10-01T19:42:18.357+00:00

    Hello @Navneet ,

    Apologize for delayed response. I just wanted to see if you're still having issues, because it's been a while since your original post date.

    I would recommend you to use Content-Type = application/x-www-form-urlencoded so that if there any special character in secret which won't be modifying during HTTP call also wondering were you able to use same in different tool like POSTMAN to testing authentication?

    Reference: https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow#get-a-token

    Hope this helps.

    ------
    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments

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.