ASP.NET Web Api AddMicrosoftGraph #2343
Unanswered
brianpmccullough
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hello @brianpmccullough what is your appsettings.json? (in particular do you have ClientSecret or ClientCertificates or ClientCredentials? Also, you don't need to reference these explicitly:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I've been following along to add Microsoft Graph to an ASP.NET Core 6 Web Api: https://github.com/AzureAD/microsoft-identity-web/blob/jmprieur/Graph5/src/Microsoft.Identity.Web.GraphServiceClient/Readme.md
I have tried different permutations of adding the config, but getting the following when attempting to access the Graph using the GraphServiceClient to simply get the current user's details (name, photo, etc).
If it helps any, I am generating the initial Bearer token using AadHttpClient within SharePoint Framework (SPFx). See: https://learn.microsoft.com/en-us/sharepoint/dev/spfx/use-aadhttpclient
I have confirmed my project is using the following references (latest for .NET Core 6):
MSAL.NetCore.4.54.1.0.MsalClientException:
ErrorCode: Client_Credentials_Required_In_Confidential_Client_Application
Microsoft.Identity.Client.MsalClientException: One client credential type required either: ClientSecret, Certificate, ClientAssertion or AppTokenProvider must be defined when creating a Confidential Client. Only specify one. See https://aka.ms/msal-net-client-credentials.
Beta Was this translation helpful? Give feedback.
All reactions