-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Allow revoked_at to be set in the future, for future expiry #452
Conversation
It is adviced in the spec that refresh tokens get invalidated: http://tools.ietf.org/html/rfc6749#section-10.4. However, I am open to discuss if it should be an option, to allow developers to extend longer-lived refresh tokens. Open question for me now, will research. Regarding Do you know why IFTT requests that refresh tokens are not revoked immediately? |
Note: specific bit of code that revokes a refresh token upon use: https://github.com/doorkeeper-gem/doorkeeper/blob/master/lib/doorkeeper/oauth/refresh_token_request.rb#L31-L32 |
Thank you @tute. IFTTT says:
This means that they may attempt to use an old refresh token, which means that their integration would not work. We would like a way for refresh tokens to not expire immediately, but at some future date ourselves that we set. This way, IFTTT would be able to use any recent token within the system. |
Your solution seems a good workaround (I'd add a configuration option to set when should they get revoked – Thanks for your input! |
@radar I like your change, can you please fix the tests (there's a type error), and rebase so I merge? Thanks for your work! |
Thanks @tute. I've force-pushed on my branch now and the commit for this PR has all the tests passing locally for me. |
Allow revoked_at to be set in the future, for future expiry
Thanks! 👍 |
@francesle see the options:
|
I'm actually referring to the refresh token. This pull request seems to be the most relevant: #578 |
Right, that's WIP right now. |
For anyone else still struggling with this, the trick for us (we're integrating with IFTTT as well) is to ensure you are using the See (line 35) doorkeeper/lib/doorkeeper/oauth/refresh_token_request.rb Lines 30 to 39 in bf36149
and (line 44) doorkeeper/lib/doorkeeper/orm/active_record/access_token.rb Lines 43 to 45 in 07d1555
|
Hello,
I'm working with IFTTT integration on a project and they've requested that a refresh token is not revoked immediately. I have no idea how to implement this in doorkeeper without setting
revoked_at
to a future time. I noticed that therevoked?
method merely checks if that field is set, and not if that time has yet passed. This PR attempts to rectify that behaviour.If you know of a better way to keep refresh tokens around, I would love to hear about it.
Thanks!