mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 12:45:52 +03:00
[GH-ISSUE #162] How to refresh token #97
Labels
No labels
bug
cocoapod
duplicate
enhancement
feature-request
help wanted
help wanted
invalid
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/OAuthSwift#97
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @czzhengkw on GitHub (Dec 19, 2015).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/162
I have success to get access_token
But the token has an expire time, I have to refresh token in 10 minutes.
@phimage commented on GitHub (Dec 19, 2015):
oauth provider? (api link)
oauth version? (1 or 2)
Refresh token RFC
http://tools.ietf.org/html/rfc6749#section-1.5
http://tools.ietf.org/html/rfc6749#section-6
http://tools.ietf.org/html/rfc6749#section-10.4
make a post request on the url described by your oauth provider
sample: POST xxx/refresh?refresh_token=XXX&client_id=YYY&grant_type=refresh_token&client_secret ...
expiration currently must be handled by you in failure callback, and reconnect then
https://github.com/OAuthSwift/OAuthSwift/wiki/OAuth-2.0-Token-Expiration
@fabiomassimo commented on GitHub (Feb 5, 2016):
Is it there a reason why
OAtuhSwiftdoes not implement the refresh mechanism but itself?I believe a good start would be to add
expires_inandrefresh_tokenproperties in theOAuthSwiftCredentialobject such that those can be exposed to the client that might need to kick off a "token refresh" request.I'd like to make a PR about this but I'm not sure if this kind of implementation is against the
OAuthSwift's roadmap.Thanks.
@phimage commented on GitHub (Feb 5, 2016):
@fabiomassimo no reason I think
(I use only oauth1 so I did not investigate this topic, just make some google and rfc search to provide some answer)
every PR is welcomed about this subject