【问题标题】:CORS when trying to retrive refresh token from google ouath尝试从 google oauth 检索刷新令牌时的 CORS
【发布时间】:2013-09-25 07:14:05
【问题描述】:

按照 [https://developers.google.com/accounts/docs/OAuth2InstalledApp][1] 我正在尝试获取用户刷新令牌,但发送这样的请求:

    POST /o/oauth2/token HTTP/1.1
Host: accounts.google.com
Content-Type: application/x-www-form-urlencoded

code=4/v6xr77ewYqhvHSyW6UJ1w7jKwAzu&
client_id=8819981768.apps.googleusercontent.com&
client_secret={client_secret}&
redirect_uri=https://oauth2-login-demo.appspot.com/code&
grant_type=authorization_code

我遇到了 cors 问题 - Access-Control-Allow-Origin 不允许。

有人有这个问题吗?

【问题讨论】:

    标签: google-api oauth-2.0 cors


    【解决方案1】:

    请记住,刷新令牌不适用于客户端代码。特别是,您以这种方式披露您的客户机密。刷新令牌只能在服务器端代码中使用,您将不受浏览器强制执行的源控制的约束。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-06-27
    • 1970-01-01
    • 2015-01-28
    • 1970-01-01
    • 2021-11-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-24
    相关资源
    最近更新 更多