-
Notifications
You must be signed in to change notification settings - Fork 2k
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
httr::oauth2.0_token$refresh() returns "argument is of length zero" #690
Comments
Your usage of the You're sort of trying to do This search of other R packages on CRAN that use https://github.com/search?q=oauth2.0_token+path%3AR+org%3Acran |
Hi Jenny, Thank you for your reply. I will re-evaluate my approach. However, I followed Hadley's example found here, so I was under the impression that my approach was bulletproof. Do you suggest that the error given stems from my approach? Or was that just a comment? |
That gist is specifically for a Shiny context and is doing some unconventional things. Are you doing OAuth 2 in Shiny? Yes, my hunch is that that approach is the root cause of your pain. |
Ah! Of course, maybe I should have added that. Yes, it is specifically for Shiny! However, the behavior is not consistent. I literally just tried to run <Token>
<oauth_endpoint>
authorize: https://link.tink.com/1.0/authorize/
access: https://api.tink.se/api/v1/oauth/token
<oauth_app> Tink with R
key: 8f5f1b32c8f54defa1c9c36fb5ddb86d
secret: <hidden>
<credentials> token_type, expires_in, access_token, refresh_token, scope
--- Im not sure what to make of it really. |
Well, in that case, I'll pipe down as I haven't really digested that gist. But I imagine it does represent a certain amount of ... creative problem-solving, i.e. use of httr that was not planned from the beginning. So it's not a shock that "your mileage may vary", with a different API, etc. |
Hi Jenny! Ive been experimenting a bit. And wanted your feedback - it appears that the option to I'm not entirely into the terminology; so I hope my question is clear. If not Ill clarify further! |
Here's a good explainer of the vocabulary: https://auth0.com/learn/refresh-tokens/ Although it feels backwards to me, the refresh token is the less perishable thing (although they can also be revoked or rendered invalid in many ways). Generally refresh tokens have some persistence and are what allows you to get new access tokens, which are highly perishable. |
httr has been superseded in favour of httr2, so is no longer under active development. If this problem is still important to you in httr2, I'd suggest filing an issue offer there 😄. Thanks for using httr! |
I have the following
token
,Which were generate by,
And
r token$can_refresh()
isTRUE
. However, when I user token$refresh()
I get the followingerror
;It was my understanding, according to the documentation, that
r token$refresh()
should work "out of the box". Examining thesource
of thefunction
leads to no predictable errors, as thequery
made is aligned with that of the OAuth workflow.Am I missing somehting, or is this a bug?
I was expecting that using
r token$refresh()
would refresh thetoken
without the user having to log in!Im working on a
package
, that I plan to release as soon as I solve this hurdle.Best,
Serkan Korkmaz
The text was updated successfully, but these errors were encountered: