TestsTested | ✓ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Dec 2016 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✗ |
Maintained by Pedro Piñera.
To run the example project, clone the repo, and run pod install
from the Example directory first.
Paparajote is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "Paparajote"
In order to use Paparajote you have to make sure the provider is supported. You can check it in the list of supported providers. If it’s not supported, you can easily give support to a new provider conforming the protocol:
public typealias Authorization = () -> NSURL
public typealias Authentication = NSURL -> NSURLRequest?
public typealias SessionAdapter = (NSData, NSURLResponse) -> OAuth2Session?
public protocol OAuth2Provider {
var authorization: Authorization { get }
var authentication: Authentication { get }
var sessionAdapter: SessionAdapter { get }
}
If you’re using UIWebView
from UIKit
you can trigger the OAuth2 with a few simple steps:
OAuth2WebviewDelegate
passing the provider, the webview, and a completion closure that will be executed once the authentication completes.ViewController
.If you’re using WKWebView
from WKWebKit
you can trigger the OAuth2 with a few simple steps:
OAuth2WKNavigationDelegate
passing the provider, the webview, and a completion closure that will be executed once the authentication completes.ViewController
.This project is funded and maintained by Caramba. We
Check out our other open source projects, read our blog or say
Contributions are welcome
Paparajote is available under the MIT license. See the LICENSE file for more info.