【问题标题】:django oauth2 provider 401 after getting token获取令牌后的django oauth2提供程序401
【发布时间】:2017-12-28 19:17:39
【问题描述】:

我在我的 django 应用程序中使用了Django Oauth2 toolkit。我的客户端是一个 Angular Web 应用程序,并使用 django api 和 oauth2。 它在我的本地主机中完美运行,一切正常,但是当我在成功登录后在服务器中使用应用程序并在请求另一个具有身份验证的页面时获取访问令牌时,会发生 401 错误。

client 是 client.example.com,django api 在 api.example.com。

请帮帮我...

请求令牌:

client_id:ePmICVI9Dwsb0eKCv8aMTKvq4Jnr7ewtFWFZGLEu
grant_type:password
username:mohammad
password:mz575451
client_secret:2RGeORI0eZbKFZX3gYtjGy

回复:

{"expires_in": 36000, "token_type": "Bearer", "access_token": "yzKlTXuDLOZj5wGescfkNiejyYKhg2", "scope": "read write", "refresh_token": "JJp5Kxq3PcDQthwvSLxvfW2Ee5rLUE"}

【问题讨论】:

  • 也许您想发布更多密码?您应该更改网址。 client.example.com 不是您的网站。将其更改为实际名称并更改您的密码

标签: django oauth-2.0


【解决方案1】:

【讨论】:

    猜你喜欢
    • 2018-03-06
    • 1970-01-01
    • 2013-03-01
    • 1970-01-01
    • 2022-08-23
    • 1970-01-01
    • 2019-05-30
    • 2015-08-31
    • 2021-01-23
    相关资源
    最近更新 更多