【发布时间】:2016-09-30 22:23:32
【问题描述】:
我正在尝试对获得 read, write 访问 Trello API 权限的用户进行身份验证。我正在使用OAuth1Swift 进行身份验证,但无法添加参数以添加权限和app name。
我们如何添加这些参数?这是我下面的代码。
func doOAuthTrello() {
let oauthswift = OAuth1Swift(
consumerKey: "consumerKey",
consumerSecret: "consumerSecret",
requestTokenUrl: "https://trello.com/1/OAuthGetRequestToken",
authorizeUrl: "https://trello.com/1/OAuthAuthorizeToken",
accessTokenUrl: "https://trello.com/1/OAuthGetAccessToken"
)
self.oauthswift = oauthswift
oauthswift.authorizeURLHandler = getURLHandler()
let _ = oauthswift.authorize(
withCallbackURL: URL(string: "oauth-swift://oauth-callback/trello")!,
success: { credential, response, parameters in
self.showTokenAlert(name: serviceParameters["name"], credential: credential)
self.testTrello(oauthswift)
},
failure: { error in
print(error.localizedDescription, terminator: "")
}
)
}
【问题讨论】: