Home

Awesome

OAuthSwiftAlamofire

<img src="https://raw.githubusercontent.com/OAuthSwift/OAuthSwift/master/Assets/OAuthSwift-icon.png" alt="OAuthSwift" hspace=20 /> <img src="https://raw.githubusercontent.com/Alamofire/Alamofire/master/alamofire.png" alt="Alamofire" width = "400"/>

Join the chat at https://gitter.im/OAuthSwift/OAuthSwift License Platform Language Cocoapod Carthage compatible

Utility methods to use OAuthSwift to sign Alamofire request.

How to use

This framework provide a RequestInterceptor to set into alamofire Session

let interceptor = oauthswift.requestInterceptor
let session = Session(interceptor: interceptor)

Then you can make you request as usual

session.request("http://oauthbin.com/v1/echo")

or pass the interceptor as argument of request function

session.request("http://oauthbin.com/v1/echo", interceptor: interceptor)

:warning: you must have call authorize function on your OAuthSwift or nothing will be signed.

Refresh token

The OAuth2 interceptor will also automatically refresh the access token, using the Alamofire RequestRetrier mechanism.

Installation

Support Carthage

github "OAuthSwift/OAuthSwiftAlamofire"

Support CocoaPods

use_frameworks!

pod 'OAuthSwiftAlamofire'