OAuthSwiftAlamofire

Utility methods to use OAuthSwift to sign Alamofire request.

How to use

This framework provide a RequestAdapter to set into alamofire SessionManager

let sessionManager = SessionManager.default
sessionManager.adapter = oauthSwift.requestAdapter // or OAuthSwiftRequestAdapter(oauth)
Swift

Then you can make you request as usual

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

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

Refresh token

The OAuth2 adapter will also automatically refresh the access token, using the Alamofire RequestRetrier mecanism.

let sessionManager = SessionManager.default
sessionManager.retrier = oauthSwift.requestAdapter
Swift

Installation

Support Carthage

github "OAuthSwift/OAuthSwiftAlamofire"
  • Run carthage update.
  • On your application targets’ “General” settings tab, in the “Embedded Binaries” section, drag and drop OAuthSwift.framework from the Carthage/Build/iOS folder on disk.

Support CocoaPods

  • Podfile
use_frameworks!

pod 'OAuthSwiftAlamofire'

GitHub

Utility method to sign Alamofire requestRead More

Latest commit to the master branch on 11-4-2020
Download as zip