-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Description
The SDK/API injects a code_verifier prop to the API call data when in fact it shouldn't be there. That's causing an invalid_grant error stating code_verifier or verifier is not needed.
The code_verifier prop should not be injected (it is undefined in the payload).
The SDK/API works fine with the same code in versions below 150, so it's likely a change in this version which is causing this behavior. I haven't been able to find documentation around it.
Repro URL: https://github.com/murtuzaalisurti/search-console-api
Upgrade googleapis to v150
npm run dev
hit localhost:3000
try to login using your google account
config: {
retry: true,
retryConfig: {
httpMethodsToRetry: [Array],
currentRetryAttempt: 0,
retry: 3,
noResponseRetries: 2,
retryDelayMultiplier: 2,
timeOfFirstRequest: 1749283405106,
totalTimeout: 9007199254740991,
maxRetryDelay: 9007199254740991,
statusCodesToRetry: [Array]
},
method: 'POST',
url: URL {
href: 'https://oauth2.googleapis.com/token',
origin: 'https://oauth2.googleapis.com',
protocol: 'https:',
username: '',
password: '',
host: 'oauth2.googleapis.com',
hostname: 'oauth2.googleapis.com',
port: '',
pathname: '/token',
search: '',
searchParams: URLSearchParams {},
hash: ''
},
data: URLSearchParams {
'client_id' => '<redacted>',
'code_verifier' => 'undefined',
'code' => '<redacted>',
'grant_type' => '<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.',
'redirect_uri' => 'http://localhost:3000/oauth2callback',
'client_secret' => '<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.' },
headers: Headers {
'x-goog-api-client': 'gl-node/22.16.0',
'User-Agent': 'google-api-nodejs-client/10.0.0-rc.3'
},
body: URLSearchParams {
'client_id' => '<redacted>',
'code_verifier' => 'undefined',
'code' => '<redacted>',
'grant_type' => '<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.',
'redirect_uri' => 'http://localhost:3000/oauth2callback',
'client_secret' => '<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.' },
validateStatus: [Function: validateStatus],
responseType: 'unknown',
errorRedactor: [Function: defaultErrorRedactor],
duplex: 'half'
},
response: Response {
size: 0,
data: {
error: 'invalid_grant',
error_description: 'code_verifier or verifier is not needed.'
},
config: {
retry: true,
retryConfig: [Object],
method: 'POST',
url: URL {},
data: [Object],
headers: Headers {
'x-goog-api-client': 'gl-node/22.16.0',
'User-Agent': 'google-api-nodejs-client/10.0.0-rc.3'
},
body: [Object],
validateStatus: [Function: validateStatus],
responseType: 'unknown',
errorRedactor: [Function: defaultErrorRedactor],
duplex: 'half'
},
[Symbol(Body internals)]: {
body: [Gunzip],
stream: [Gunzip],
boundary: null,
disturbed: true,
error: null
},
[Symbol(Response internals)]: {
type: 'default',
url: 'https://oauth2.googleapis.com/token',
status: 400,
statusText: 'Bad Request',
headers: [Object],
counter: 0,
highWaterMark: 16384
}
},
code: 400,
status: 400,
error: undefined,
[Symbol(gaxios-gaxios-error)]: '7.0.0-rc.6',
[cause]: { message: 'invalid_grant', code: 400, status: 'Bad Request' }
}rubixvi, itsjgf, bensperr, ymeskini, ljubica-leap and 6 more
Metadata
Metadata
Assignees
Labels
No labels