Ruby Google Analytics API无效grant_type

时间:2014-12-04 20:55:10

标签: ruby-on-rails ruby api google-analytics google-api-client

使用Google API客户端gem我无法传递fetch_access_token!方法。我一直收到错误Authorization failed. Server message: {error: invalid_grant}

key = Google::APIClient::KeyUtils.load_from_pkcs12(file, passphrase)
client = Google::APIClient.new
client.authorization = Signet::OAuth2::Client.new(
  token_credential_uri: "xxxx",
  audience: "xxxx",
  scope: "xxxx",
  issuer: "xxxx", # the service account email
  signing_key: key,
)

client.authorization.fetch_access_token!

当我举起client.authorization.grant_type时,我得到了:

urn:ietf:params:oauth:grant-type:jwt-bearer

0 个答案:

没有答案