-
Notifications
You must be signed in to change notification settings - Fork 59
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
req_oauth_password
prompts password-input continuously, but existing valid token are used
#498
Comments
req_oauth_password
asks for password even though existing token are usedreq_oauth_password
prompts password-input continuously, but existing valid token are used
This is definitely a bug 😄 |
Oh, a 🐛 there is. I've commented on the bugfix in #499. Now, the next step must be to see how I can test this by using the mock-functions, and finally, start building the package. Do you by any chance knows a few libs which uses httr2, which maybe even "live tests" their solution, both with and without the mock-solution in httptest2? I've looked after a good way to spot popular packages which uses httr2 and httptest2, but didn't manage to find a good solution. Inspiration is key, now that I've checked most of the documentation for both libs. The Google drive gives something, but I'm still looking after something else to take a closer look at. Thank you for fixing this! As mentioned in the PR: |
I was facing some issues in #491, but now the API part are working as expected, so I'm able to use
req_oauth_password
. However, I noticed that #119 points out thatreq_oauth_password
triggers the "Password" input prompt on all request. Even though, it's actually saving the token in the first execution, and does re-use the token in the next execution.Have I implemented something in a wrong way for my first "initial httr2-based test project"? There's no solution in #119, but hadley does request an example.
I use the following simple test-code to try and fetch "me" from "users":
I use the following for my (currently) test client, and the wrapper for my req_auth:
Using
cache_disk
does not change a thing. But it do look like it's using the existing token, even through it re-prompts me, asking me to enter the password again.I noticed this by running
with_verbosity(get_users_me())
:with_verbosity(get_users_me())
a) does a
POST /oauth/token HTTP/2
b) get's a
HTTP/2 200
c) requests the resources at
GET /users/me HTTP/2
(The Bearer are set in the headers, as expected)d) gets a
HTTP/2 200
same R session,
with_verbosity(get_users_me())
executed again.a) does a
GET /users/me HTTP/2
(The Bearer are set in the headers, as expected)b) gets a
HTTP/2 200
However, the password input prompt shows up on both executions:
Ignore the code in the background.
In other words, it's clear to me, that the password are not used in run no. 2, but are still being prompted to the user, for some reason.
Is this a bug, or do I need to check something, and only wrap
req_oauth_password
, if it needs to be re-authenticated? (initial, once expired, and so on)?If I run the official example with github_client with
req_oauth_auth_code
, things works as I expect it to do: 1. run prompts me to grant access, and fetch the information. 2. run just fetches the information. I'm not "reprompted" to grant access.The text was updated successfully, but these errors were encountered: