@Jon Welp I tried to add them but n8n doesn’t allow it.
this is a list of everything I was NOT able to add to the data
field in the POST
request:
"data": {
"grantType": "authorizationCode",
"authUrl": "https://accounts.google.com/o/oauth2/v2/auth",
"accessTokenUrl": "https://oauth2.googleapis.com/token",
"scope": "https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/drive.appdata https://www.googleapis.com/auth/drive.photos.readonly",
"authQueryParameters": "access_type=offline&prompt=consent",
"authentication": "body"
}
The response message was always:
{
"message": "request.body.data is not allowed to have the additional property \"authQueryParameters\""
}
for the above fields it was the same error but with the appropriate field name used.
Here is a sample of the body of my POST
request that failed with the above error from n8n:
{
"name": "Test-account-000",
"type": "googleDriveOAuth2Api",
"data": {
"clientId": "xxx",
"clientSecret": "xxx",
"oauthTokenData": {
"access_token": "xxx",
"token_type": "Bearer",
"refresh_token": "xxx",
"callbackQueryString": {
"scope": "openid https://www.googleapis.com/auth/drive.readonly https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile"
},
"expires_in": 3599
},
"authQueryParameters": "access_type=offline&prompt=consent"
}
}
I of course tried all the fields mentioned and all of them failed. Tried them 1 by 1.
And @jan (sorry if being a nuisance) mentioned this: Can n8n be used to authenticate with multiple different users? - #15 by jan
So if the fields in data
are being applied automatically, is it a bug that they are not in the data, such as authQueryParameters
param, when I export a credential?
Could it be the bug preventing token refreshing?
PS: the google drive credential added by n8n credential tab UI is still working as expected, while the one added programmatically by me is still, as expected, failing