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

Test order of auth #41

Open
jonthegeek opened this issue Dec 28, 2024 · 1 comment
Open

Test order of auth #41

jonthegeek opened this issue Dec 28, 2024 · 1 comment

Comments

@jonthegeek
Copy link
Owner

If I supply bearer token and refresh, does it use the bearer token without trying refresh? Does order I add the req methods matter? Turn off internet to more easily trace.

@jonthegeek
Copy link
Owner Author

Last oauth function applied overwrites previous one(s). The main thing that I'm still not sure of is what happens if a given refresh token is bad. Does it just fail? It might try to reauth, but it doesn't have a PKCE flag, so it would presumably always use the default. I'm thinking I might want to do something along these lines:

  • "Hide" the oauth params in something like $policies$auth_sign_bak (so httr2 won't try to use them prematurely).
  • Try the query with req_auth_bearer_token() (when I have a token). Doing both of these MIGHT not be necessary but I don't know every possible situation. I think I'll have to tryCatch this myself; httr2 would overwrite any "real" req_retry(), for example. I also might want to req_error() (saving any existing req_error() settings) to let it "succeed" (without throwing an error) so I can check the response and then decide what to do next.
  • If that query fails, move oauth params to their proper home and re-try (possibly doing so for refresh before doing so for the rest of oauth, depending whether I can make them play together).

That should allow me to use the httr2 wiring, but try all the options.

If it works, consider pushing it back to httr2, but I think it's more hand-wavy-hand-holding than he's aiming for.

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

No branches or pull requests

1 participant