菜鸟教程小白 发表于 2022-12-11 19:08:24

ios - 带有 Yahoo API 的 OAuth2


                                            <p><p>我想读写用户的<a href="https://developer.yahoo.com/fantasysports/guide/" rel="noreferrer noopener nofollow">Yahoo Fantasy Sports</a>数据。</p>

<p>我正在尝试通过 <a href="https://developer.yahoo.com/oauth2/guide/" rel="noreferrer noopener nofollow">Yahoo API</a> 访问使用 <a href="https://github.com/OAuthSwift/OAuthSwift" rel="noreferrer noopener nofollow">OAuthSwift</a> . </p>

<p>我的 OAuthSwift 对象如下所示:</p>

<pre><code>let oauth2Swift = OAuth2Swift(
    consumerKey:    &#34;*****&#34;,
    consumerSecret: &#34;*****&#34;,
    authorizeUrl:   &#34;https://api.login.yahoo.com/oauth2/request_auth&#34;,
    accessTokenUrl: &#34;https://api.login.yahoo.com/oauth2/get_token&#34;,
    responseType:   &#34;code&#34;
)
</code></pre>

<p>我是这样执行的:</p>

<pre><code>    self.oauth2Swift.authorize(withCallbackURL: &#34;com.me.myapp&#34;, scope: &#34;fspt-w&#34;, state: &#34;&#34;, success: { (cred, response, params) in
      print(&#34;✅ success&#34;)
    }) { (error) in
      print(&#34;
页: [1]
查看完整版本: ios - 带有 Yahoo API 的 OAuth2