mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 20:55:57 +03:00
[GH-ISSUE #434] configuring OAuth2 bearer authentication #282
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#282
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 @MunaTayeb on GitHub (Feb 8, 2018).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/434
Description:
I'm required to use OAuth2 bearer authentication, which is when the user login successfuly, I got an access token and refresh token from the server. once the access token expires (code 401), I use the refresh token on some endpoint to get the new access and refresh tokens, I couldn't find any guide regarding this, is it possible using this library? if yes, how to make the refreshing process automatic?
OAuth Provider (Twitter, Github, ..):
Bearer authentication
OAuth Version:
OS (Please fill the version) :
Installation method:
Library version:
Xcode version:
@phimage commented on GitHub (Feb 8, 2018):
https://github.com/OAuthSwift/OAuthSwift/wiki/OAuth-2.0-Token-Expiration
@MunaTayeb commented on GitHub (Feb 8, 2018):
I have acess token, refresh token and one endpoint which recives the refresh and send back new ones.
where should I add these three when creating an OAuth2Swift object and setting it's parameters?
@phimage commented on GitHub (Feb 8, 2018):
no where, there is no standard
see startAuthorizedRequest signature, you have a callback to make the request your self
or see OAuthSwiftAlamofire project with request retrier
@MunaTayeb commented on GitHub (Feb 11, 2018):
Ok I figure it out after reading the Wiki.. Thank you
is there a way to get the error status code? ex: 400,500 ...
@phimage commented on GitHub (Feb 11, 2018):
if requestError, you can take the underlying error as NSError or URLError
an example with NSError
https://github.com/OAuthSwift/OAuthSwift/blob/master/Sources/NSError%2BOAuthSwift.swift