Google OAuth1迁移到OAuth2

时间:2015-03-23 16:14:54

标签: migration google-oauth google-oauth2

请不要将此问题与此问题混淆:Migration from OAuth1 3L to OAuth2:

我一直在将我的系统用户从Google OAuth1迁移到OAuth2 specified here

这次迁移的常见问题是构建base_string,这在我提出这个问题之前对我来说是一个问题。修复base_string构建后,我确实迁移了95%的用户,但少量用户仍然返回400错误:

{
  "error": "invalid_request",
  "error_description": "Invalid authorization header."
}

以下是要检查的最重要的字段:

base_string: POST&https%3A%2F%2Fwww.googleapis.com%2Foauth2%2Fv3%2Ftoken&client_id%3DXXX%26client_secret%3DXXX%26grant_type%3Durn%253Aietf%253Aparams%253Aoauth%253Agrant-type%253Amigration%253Aoauth1%26oauth_consumer_key%3DXXX%26oauth_nonce%3D178143337915967474871427127026%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1427127026%26oauth_token%3D1%XXX

网址:https://www.googleapis.com/oauth2/v3/token

我不得不说,此用户目前可以使用OAuth1,因此它们是完全有效的连接。无效/过期连接会返回500错误:

{
  "error": "invalid_token",
  "error_description": "Either the token is invalid or we could not decode it."
}

0 个答案:

没有答案