OGeek|极客世界-中国程序员成长平台

标题: ios - 带有 Yahoo API 的 OAuth2 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 19:08
标题: ios - 带有 Yahoo API 的 OAuth2

我想读写用户的Yahoo Fantasy Sports数据。

我正在尝试通过 Yahoo API 访问使用 OAuthSwift .

我的 OAuthSwift 对象如下所示:

let oauth2Swift = OAuth2Swift(
    consumerKey:    "*****",
    consumerSecret: "*****",
    authorizeUrl:   "https://api.login.yahoo.com/oauth2/request_auth",
    accessTokenUrl: "https://api.login.yahoo.com/oauth2/get_token",
    responseType:   "code"
)

我是这样执行的:

    self.oauth2Swift.authorize(withCallbackURL: "com.me.myapp", scope: "fspt-w", state: "", success: { (cred, response, params) in
        print("✅ success")
    }) { (error) in
        print("





欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4