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

Refresh token on authentication failure using IAuthenticationProvider / IAccessTokenProvider #496

Open
AndrewZenith opened this issue Dec 16, 2024 · 1 comment
Labels
status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:question An issue that's a question

Comments

@AndrewZenith
Copy link

Hi,

There seems to be no mechanism to allow to refresh a token if there is an authentication failure.

I would have expected there to be a call to AuthenticateRequestAsync with something in the additionalAuthenticationContext to indicate an authentication failure on the first try.

Am I missing something here?

@github-project-automation github-project-automation bot moved this to Needs Triage 🔍 in Kiota Dec 16, 2024
@baywet
Copy link
Member

baywet commented Dec 17, 2024

Hi @AndrewZenith
Thank you for using kiota and for reaching out.

We expect this concern to be handled by the authentication library. For example, in the case of Azure Identity (implemented here) or MSAL (not implemented here) both libraries handle token caching and token refreshing internally.

The name provider might be misleading here, it should most likely have been named "adapter" or something along those lines. The sole responsibility for the implementers it to "relay" or "adapt" the token acquisition to the "other parts of the infrastructure", And we did not design those interfaces to take on more responsibilities.

Let us know if you have any additional comments or questions.

@baywet baywet added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:question An issue that's a question labels Dec 17, 2024
@baywet baywet moved this from Needs Triage 🔍 to Waits for author 🔁 in Kiota Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:question An issue that's a question
Projects
Status: Waits for author 🔁
Development

No branches or pull requests

2 participants