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
155 stars 39 forks source link

[Feature] IProvider.GetTokenAsync should accept additional scopes #111

Closed shweaver-MSFT closed 3 years ago

shweaver-MSFT commented 3 years ago

Describe the problem this feature would solve

Currently, the only way to add scopes is to configure them during provider initialization. This means that it is difficult to add any additional scopes at runtime without completely reconfiguring the global IProvider instance.

Describe the solution

Enable IProvider.GetTokenAsync to accept an array of access scopes:

IProvider provider = ProviderManager.Instance.GlobalProvider;
string token = provider.GetTokenAsync(scopes: new string[] { "Tasks.ReadWrite" }, silentOnly: false);

Providing none will default to any pre-configured scopes in the provider.

Describe alternatives you've considered

None

Additional context & Screenshots

This request is inspired by the pattern in MGT.

ghost commented 3 years ago

Hello shweaver-MSFT, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌