Skip to content

Improve default oauth interceptor #515

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

Conversation

simonmulser
Copy link

In a project we have the problem that after the redirection the access_token is not available. Hence, the first requests are sent without the token even we configured the interceptor with send_access_token. In the projekt we are using a custom interceptor similar to improved interceptor in the PR, where we wait for the token to be loaded from the OAuthService. I wanted to contribute this change back.

Let me know if this change makes sense for you.

@simonmulser simonmulser force-pushed the improve-default-oauth-interceptor branch from aa575a8 to 79b36af Compare February 13, 2019 14:25
@jeroenheijmans
Copy link
Collaborator

jeroenheijmans commented Feb 13, 2019

Interesting PR! Have not had time to test it yet, but looks like a good idea. Only thing I conceptually I'm on the fence about is whether you want this behavior always, or possibly as an opt in for users. Some might prefer their own services and whatnot to handle this...

Has a (thin) relation to #414

@simonmulser
Copy link
Author

ok. let me know when and what I should adopt. could also provide some unit tests.

@manfredsteyer
Copy link
Owner

Thanks for this PR. I'm not sure about it. Does it postpone the request every time for 1 sec?

@manfredsteyer manfredsteyer added the investigation-needed Indication that the maintainer or involved community members may need to investigate more. label Jul 17, 2019
@simonmulser
Copy link
Author

nope.
if the token is present the request is sent immediatley.
if the token is not present the code waits 1 sec for the token received event.
if the token arrives in that time window the request is sent immediatley.
if not the request is sent without header.

@manfredsteyer manfredsteyer merged commit 4ee15b9 into manfredsteyer:master Jul 18, 2019
@manfredsteyer
Copy link
Owner

thx!

@manfredsteyer
Copy link
Owner

This would be a nice PR: adding a flag that makes the interceptor to refresh the token when it was expired

@manfredsteyer manfredsteyer added the pr-welcome We'd welcome a PR to solve the issue. label Nov 18, 2022
@simonmulser
Copy link
Author

@manfredsteyer you want to make this behavior configurable with a flag?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigation-needed Indication that the maintainer or involved community members may need to investigate more. pr-welcome We'd welcome a PR to solve the issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants