我用的是 django rest framework curl -X POST -d "grant_type=convert_token&client_id=<client_id>&client_secret=<client_secret>&backend=google-oauth2&token=<id_token>...
我确定我的 app_id 和 secret 没有配置错误,但是返回的是
{"error":"access_denied","error_description":"Your credentials aren't allowed"}
用的是 rest_framework_social_oauth2 来取 token 的 有没有大佬遇到过这种情况。。。
谢谢各位了!!!
1
w516322644 2019-03-21 17:04:28 +08:00
id_token 对吗?虽然没做过,但证明肯定是过去了。那就是自己的原因,去查参数,去查报错。哪没配置好?
|
2
CCColby OP @w516322644 id_token 是前端授权登陆之后,google 返回的
{ "grant_type": "convert_token", "client_id": "04ePfGbSWlriwuCnNIQlTQoJUA5uGrADXHaXLxU1", "client_secret": "PqEBgppeQ6H6GbBgErwx893ZKMdy4rFPy5Mu9DWYlUJlLPTYKBkEKaXHlet7gdYp757F6rL3F6TocHRhcTaTbimi7ue0imSDKdtMufKpIfMUqkNHUKRBR7cWWduj64N6", "backend": "google-oauth2", "token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjA5MDVkNmY5Y2Q5YjBmMWY4NTJlOGIyMDdlOGY2NzNhYmNhNGJmNzUiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJhY2NvdW50cy5nb29nbGUuY29tIiwiYXpwIjoiNDEyNDM4NDU1NDcwLWJnbHB2MTFoN2htaGFkN3JkNTVtMmRtdWszZGtwOWk0LmFwcHMuZ29vZ2xldXNlcmNvbnRlbnQuY29tIiwiYXVkIjoiNDEyNDM4NDU1NDcwLWJnbHB2MTFoN2htaGFkN3JkNTVtMmRtdWszZGtwOWk0LmFwcHMuZ29vZ2xldXNlcmNvbnRlbnQuY29tIiwic3ViIjoiMTEwMzM2OTE3OTM3MjYxODEyMTE5IiwiZW1haWwiOiIxMzA1MTAxNzY1QHFxLmNvbSIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJhdF9oYXNoIjoiMHNGQVhkQVl5eWdvdHVHLTVIZkI1ZyIsIm5hbWUiOiJ4cWRvbmcgeHFkb25nIiwicGljdHVyZSI6Imh0dHBzOi8vbGg2Lmdvb2dsZXVzZXJjb250ZW50LmNvbS8tQ2JQVnFaVWZVSFUvQUFBQUFBQUFBQUkvQUFBQUFBQUFBQUEvQUNIaTNyY2hQSmtDdk96OEJRRmljekZEMm5FcEYxV002US9zOTYtYy9waG90by5qcGciLCJnaXZlbl9uYW1lIjoieHFkb25nIiwiZmFtaWx5X25hbWUiOiJ4cWRvbmciLCJsb2NhbGUiOiJ6aC1DTiIsImlhdCI6MTU1MzE1OTY1MSwiZXhwIjoxNTUzMTYzMjUxLCJqdGkiOiI0MmRmYzRhMjBjZGI5MTU0NjNhYmJlNzNiZGZkODI0MTg3MGEzMzdiIn0.egcj7C46tvrrX9PpHOMWYQdrosVVXoDkyyIfSvw-t4uyPvefVzuC-XeXXgU9xjueyTZaGnbR_S-96KRKaSrfLBHwLUcub3_FjpcwY699gIbadEKo5wAE6Dzxm1nlT_YjMziGDb3v3965DnY2WxOvVZ2j4XnMh-oKcBnZs4oE_FnVo5hpqq6ldpLcMqMSM539vsoDLsWPPmh1gMhN1FrQ1E_wBKB990IwZtkKqKJWkpHDiRFvfNJvlkxyZlZXsWhiCSjXXa8K1l9pCd4BKQvRJXaON2b5N3kWVbgyV1b_B8PpKvgXXbw_Qf1B04EmxveMaYdcNgphvJZNjnFiybg5cA" } |
3
wxl1380610 2019-03-21 17:17:01 +08:00
|
4
CCColby OP @wxl1380610 这个我是设置在 settings.py 里面的,post 的使用的 client_id 与 client_secret 是自定义创建的 application
|
5
CCColby OP 最后发现是用 access_token
|