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

Jmprieur/related to249 #271

Merged
merged 3 commits into from
Jun 29, 2020
Merged

Jmprieur/related to249 #271

merged 3 commits into from
Jun 29, 2020

Conversation

jmprieur
Copy link
Collaborator

This PR is there to prepare the work on #249 which consists in removing the TokenAcquisitionSingleton property from the Microsoft.Identity.Options (and the associated management and tests). AddMicrosoftWebAppCallsWebApi / AddMicrosoftWebApiCallsWebApi would systematically do AddTokenAcquisition(), which means AddTokenAcquisition(false), as this the default value is false.

The solution below consists in having AddMicrosoftGraph call directly AddTokenAcquisition(true) (to set it up as a singleton), instead of having the user to specify a different option in the config file, which s/he could forget to do, and would require more documentation. Then AddTokenAcquisition() removes the previous service and readds it, if needed, with the right lifetime.

The last call to AddTokenAcquisition() wins. Therefore the call to AddMicrosoftGraph needs to happen after the calls to AddMicrosoftWebAppCallsWebApi / AddMicrosoftWebApiCallsWebApi

Copy link
Collaborator

@jennyf19 jennyf19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@jmprieur jmprieur merged commit 1593428 into master Jun 29, 2020
@jmprieur jmprieur deleted the jmprieur/relatedTo249 branch June 30, 2020 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants