Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.57k stars 4.83k forks source link

[QUERY] AuthenticateAsync() causes error invalid_client AADSTS650057 #47358

Open DanielHWe opened 4 days ago

DanielHWe commented 4 days ago

Library name and version

Azure.Identity 1.13.1

Query/Question

I tryed to persist a AuthenticationRecord like described in section "Silently authenticate a user with AuthenticationRecord and TokenCachePersistenceOptions" of TokenCache

But I always ending in getting the error Error details: error invalid_client error_description: AADSTS650057: Invalid resource. The client has requested access to a resource which is not listed in the requested permissions in the client's application registration.

Eroor shown in Browser by calling AuthenticationRecord authRecord = await credential.AuthenticateAsync();

I tryed to change the scope and the API Permissions in entry, currently I have File.ReadWrite.All, Application.ReadWrite.All, Directory.ReadWrite.All, AuthenticationContext.Read.All, offline_access, openid, profile, User.read.

But that did not help.

I have a WPF Desktop App and how may I able to Silently authenticate a user, so he must not login within the browser each time the application is restarted. (Currently I'm using InteractiveBrowserCredentialOptions)

Environment

Windows 11, .Net 8, WPF Desktop App

github-actions[bot] commented 4 days ago

Thank you for your feedback. Tagging and routing to the team member best able to assist.