CommunityToolkit / Graph-Controls

Set of Helpers and Controls for Windows development using the Microsoft Graph.
https://docs.microsoft.com/en-us/windows/communitytoolkit/graph/overview
Other
154 stars 39 forks source link

Fix AAD silent login problem #173

Closed Richasy closed 2 years ago

Richasy commented 2 years ago

PR Type

What kind of change does this PR introduce?

What is the current behavior?

After logging in to the AAD account, close and reopen the application, the login panel will still pop up instead of silent login.

What is the new behavior?

Store the Authority property of the AAD account correctly, so that account data can be obtained when reading the locally cache.

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

MSA and AAD accounts require different authorization methods. The snippets from this document are as follows:

Notice that we also pass the string "consumers" to the optional authority parameter. This is because Microsoft provides two different types of authentication - Microsoft Accounts (MSA) for "consumers", and Azure Active Directory (AAD) for "organizations". The "consumers" authority indicates we want the MSA option. If you're developing an enterprise app, use the string "organizations" instead.

ghost commented 2 years ago

Thanks Richasy for opening a Pull Request! The reviewers will test the PR and highlight if there is any merge conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌