aerogear-ios-oauth2基于 aerogear-ios-http 的 OAuth2 客户端
aerogear-ios-oauth2 是基于 aerogear-ios-http 的 OAuth2 客户端。
特性:
- 多个OAuth2帐户的 Account manager
- 请求访问和刷新令牌,
- 通过安全的外部浏览器和URI模式授予访问权限以重新输入应用程序,
- (隐式或显式)刷新令牌,
- 撤销令牌,
- 永久安全存储,
- 适用于OAuth2特定的提供程序。现有扩展:Google,Facebook,Keycloak
- OpenID Connect登录
示例:
var Http = Http() // [1]
let facebookConfig = FacebookConfig( // [2]
clientId: "YYY",
clientSecret: "XXX",
scopes:["photo_upload, publish_actions"])
var oauth2Module = AccountManager.addFacebookAccount(facebookConfig) // [3]
http.authzModule = oauth2Module // [4]
http.GET("/get", completionHandler: {(response, error) in // [5]
// handle response
})评论
