Swiftpack.co - OAuthSwift/OAuthSwiftAlamofire as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by OAuthSwift.
OAuthSwift/OAuthSwiftAlamofire 1.0.0beta
Utility method to sign Alamofire request
⭐️ 104
🕓 3 years ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/OAuthSwift/OAuthSwiftAlamofire.git", from: "1.0.0beta")

OAuthSwiftAlamofire

OAuthSwift Alamofire

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"
  • 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

link
Stars: 104
Last commit: 3 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics