Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Build a LoginButton control based on WebAccount metadata #126

Open
shweaver-MSFT opened this issue Jul 19, 2021 · 0 comments
Open

Comments

@shweaver-MSFT
Copy link
Member

shweaver-MSFT commented Jul 19, 2021

Describe the problem this feature would solve

Currently, the LoginButton uses Graph to request the user display name and image. This returns an experience that is consistent across surfaces that also use Graph data, but not necessarily consistent with Windows. Apps/services on Windows desktop use the details provided by the WebAccount object returned by the Windows platform.

We should offer a solution that is more inline with what the OS is doing. Added bonus is that it doesn't require a Graph request, so the button can be written entirely with Windows APIs, without any additional steps or explicit web requests.

Describe the solution

  • In the CommunityToolkit.Authentication.Uwp package, create a new LoginButton based control
    • Copy code where it makes sense, don't build on top of the existing LoginButton to avoid taking dependency on Graph
  • Remove references to the Graph SDK and swap the Graph User object reference for WebAccount instead.
  • Update the LoadState method to pull the WebAccount from an active WindowsProvider and load the username and photo.
    • If the GlobalProvider is not an instance of WindowsProvider, disable the control.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant