-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
Skipping authentication when request is cached #384
Comments
A simple solution could be to cache your access token to reduce the number of token requests when your requests are cached aswell. |
I mean I yes but I was wondering if someone has a neat solution so that only occurs when needed instead of anytime the auth cache expires which is far more often in my situation I do have a workaround but again if there isn't a built in solution perhaps it's a good one for the roadmap as it does make sense |
if I'm not missing something in your quest I think this should cover you: https://docs.saloon.dev/conclusion/how-to-guides/per-request-authentication |
Hey @ClaraLeigh is this an OAuth2 integration or is your If it's OAuth2 you're after, I will keep investigating |
@Sammyjo20 This is OAuth2, with the example code coming straight from the docs at: https://docs.saloon.dev/digging-deeper/oauth2-authentication/client-credentials-grant Could definitely hack something into the per request too, I missed that doc hiding down there. Not sure its much neater than my current personal hack, so I might skip it for now. Either way though I feel like this should probably be built in when using something like oAuth. Maybe something to put in for v4? |
Hey @ClaraLeigh sorry for the delay on looking at this one more, I will hopefully look soon for you! |
@Sammyjo20 definitely not urgent by any means. I have a cache wrapper for my usecase which solves the problem. Would definitely improve the program itself to have this though |
Hey :)
I've been trying to think up a good way to skip authentication if a request has already been cached.
So for example, straight from the docs:
If the GetInventoryRequest is cached, the request to fetch a new access token will still occur.
I will likely try and come up with a dirty hack for today to fix this for myself, but I'm wondering if there is a clean way to do this?
ie, have the authentication inside the Request so it only runs if needed
The text was updated successfully, but these errors were encountered: