我使用flask-oauthlib实现了oauth2服务器和oauth2客户端.
当我尝试在本地测试时,客户端返回InsecureTransportError并告诉我应该使用https.
有没有办法在没有https的情况下在本地测试应用程序?
客户端在127.0.0.2:5000上运行,服务器在127.0.0.1:5000上运行.
谢谢
试图让 OAuth2 Google 登录工作,这是我的应用程序发出的原始请求:
方法: POST
网址: https://www.googleapis.com/oauth2/v3/token
标题: Content-Type: application/x-www-form-urlencoded
价值观:
client_id: XXX-0123456789abcdef0123456789abcdef.apps.googleusercontent.com
client_secret: A1b2C3d4E5f6G7h8I9j0K1l2M
code: 1/A1b2C3d4E5f6G7h8I9j0K1l2M3n4O5p6Q7r8S9t0U1v
grant_type: authorization_code
redirect_uri: http://localhost:5000/callback/google/
这是回应:
地位: 401 Unauthorized
身体:
{
"error": "invalid_client",
"error_description": "Unauthorized"
}
Run Code Online (Sandbox Code Playgroud)
已验证这是我的应用程序正在制作的确切请求/响应(使用 Flask 和 rauth 的 Python 应用程序),并已验证我可以使用 Postman 重现完全相同的请求/响应。
根据其他线程中的说明,我在 Google API 控制台中完成了以下所有操作:
无论我做什么,仍然得到相同的响应"invalid_client": "Unauthorized"。
对此的帮助将不胜感激。我正在尝试在我的应用程序中设置 OAuth2 驱动的“使用 X 登录”功能,已经让 Facebook 和 Twitter 正常工作,也想让 …