Hey @Jon, Thanks for the welcome!
I don’t know how to pass do the calls inside of Oauth2Api.credentials.ts
For example, when doing credentials inside Zapier I would do something like this:
config: {
type: “oauth2”,
oauth2Config: {
authorizeUrl: {
method: “GET”,
url: url/oauth/authorize
,
params: {
response_type: “code”,
redirect_uri: “{{bundle.inputData.redirect_uri}}”,
},
},
getAccessToken: {
url: url/oauth/token
,
method: “POST”,
headers: {
“content-type”: “application/x-www-form-urlencoded”,
accept: “application/json”,
},
body: {
code: “{{bundle.inputData.code}}”,
grant_type: “authorization_code”,
},
removeMissingValuesFrom: {},
},
refreshAccessToken: {
url: url/oauth/token
,
method: “POST”,
body: {
refresh_token: “{{bundle.authData.refresh_token}}”,
grant_type: “refresh_token”,
},
headers: {
“content-type”: “application/x-www-form-urlencoded”,
accept: “application/json”,
},
},
},
But here credentials look like this:
properties: INodeProperties[] = [
{
displayName: ‘Grant Type’,
name: ‘grantType’,
type: ‘hidden’,
default: ‘authorizationCode’,
},
{
displayName: ‘Authorization URL’,
name: ‘authUrl’,
type: ‘hidden’,
default: ‘url/oauth/authorize’,
required: true,
},
{
displayName: ‘Redirect URI’,
name: ‘redirect_uri’,
type: ‘hidden’,
default: ‘url/oauth/token’,
required: true,
},
{
displayName: ‘Access Token URL’,
name: ‘accessTokenUrl’,
type: ‘hidden’,
default: ‘url/oauth/token’,
required: true,
},
{
displayName: ‘Scope’,
name: ‘scope’,
type: ‘hidden’,
default: ‘’,
},
{
displayName: ‘Auth URI Query Parameters’,
name: ‘authQueryParameters’,
type: ‘hidden’,
default: ‘’,
},
{
displayName: ‘Authentication’,
name: ‘authentication’,
type: ‘hidden’,
default: ‘body’,
},
];
Where should I pass the headers, parameters, body, method? So that N8N can handle the oAuth2.