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

Refactor AccessTokenProvider to relieve some concerns to TokenRequestContext #24

Open
Ndiritu opened this issue Jan 8, 2025 · 0 comments
Labels
type:breaking-change An issue that will result in dependent client projects failing. type:enhancement Enhancement request targeting an existing experience

Comments

@Ndiritu
Copy link
Contributor

Ndiritu commented Jan 8, 2025

PhpLeagueAccessTokenProvider mixes two many concerns:

  • wrapper between the authentication provider and the auth context (original design)
  • validates hosts through the validator (original design)
  • CAE support (original design)
  • provides observability information (original design)
  • token caching (not part of original design)
  • token refresh (same)

Because of that, and specialization with national endpoints, to expose the full API surface, we're leaking those concerns to derived classes, or required to add this setter.

And even with the latter approach, their does not seem to be a way for a consumer of the Graph Authentication Provider to set the token cache for the access token provider... Masking some of the customization abilities, or loosing the specialization for national clouds etc in the process.

Beyond the degraded developer experience, we risk introducing "experience bugs" where settings things one way doesn't flow all the way down, but does by using another API.

I believe the correct thing to do would be to move the concerns that should not be in PhPLeagueAccessTokenProvider to the token request context. I understand this is a significant undertaking and would be considered a breaking change.

further context: microsoft/kiota-authentication-phpleague-php#106

@Ndiritu Ndiritu transferred this issue from microsoft/kiota-authentication-phpleague-php Feb 10, 2025
@Ndiritu Ndiritu added this to Kiota Feb 10, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage 🔍 in Kiota Feb 10, 2025
@Ndiritu Ndiritu added type:enhancement Enhancement request targeting an existing experience type:breaking-change An issue that will result in dependent client projects failing. labels Feb 10, 2025
@Ndiritu Ndiritu moved this from Needs Triage 🔍 to New📃 in Kiota Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:breaking-change An issue that will result in dependent client projects failing. type:enhancement Enhancement request targeting an existing experience
Projects
Status: New📃
Development

No branches or pull requests

1 participant