SwiftOAuth2OAuth2 的 Swift 實(shí)現(xiàn)
SwiftOAuth2 是 OAuth2 的 Swift 實(shí)現(xiàn)。
使用
首先要?jiǎng)?chuàng)建一個(gè) CROAuth2Client 對(duì)象:
// From a UIViewController (used to present the authentication webview if necessary) CROAuth2Client.clientWithPresentingController(self)
簡(jiǎn)單的查詢?cè)L問 token:
self.client!.retrieveAuthToken({ (authToken) -> Void in
if let optionnalAuthToken = authToken {
println("Received access token " + optionnalAuthToken)
}
})評(píng)論
圖片
表情
