JMeterでoAuthトークンを取得するPOST呼び出しを行っています。 Googleドライブにファイルをアップロードできるようにします。以下はJMeterのリクエストの詳細です。JMeterでOauth2でGoogleに認証
POST https://accounts.google.com/o/oauth2/token
POST data:
client_id=<my_client_id>&auth_uri=https%3A%2F%2Faccounts.google.com%2Fo%2Foauth2%2Fauth&token_uri=https%3A%2F%2Faccounts.google.com%2Fo%2Foauth2%2Ftoken&client_secret=<my_client_secret>&grant_type=authorization_code&redirect_uris=%5B%22urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob%22%2C+%22127.0.0.1%3A3000%22%5D%0A&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive
[no cookies]
Request Headers:
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 424
Host: accounts.google.com
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_121)
しかし、私は下にエラーが発生しています。どんな助けもありがとうございます。ありがとう。
{
:
"error"
: : "invalid_request",
: "error_description" : "Missing required parameter: code"
}
これはお役に立ちますか? https://developers.google.com/identity/protocols/OAuth2 – Tanaike
これを確認しました。しかし、JMeterでリクエストを作成できませんでした。 –
ファイルをアップロードする場合は、アクセストークンが必要です。アクセストークンを取得する場合は、スコープを持つURLから取得したコードが必要です。 – Tanaike