Add multiple Auth URI Query Parameters in OAuth2Api

How can I add multiple Auth URI Query Parameters in OAuth2Api?

My workflow

/* eslint-disable n8n-nodes-base/cred-filename-against-convention */
import { ICredentialType, INodeProperties } from 'n8n-workflow';

export class NhanhvnOAuth2Api implements ICredentialType {
	name = 'nhanhvnOAuth2Api';
	extends = ['oAuth2Api'];
	displayName = 'Nhanhvn OAuth2 API';
	documentationUrl =
		'https://www.notion.so/Qonto-Sandbox-Useful-Information-3f1e39b04dbc4ea380bdd46500f9762f';
	properties: INodeProperties[] = [
		{
			displayName: 'Client ID',
			name: 'clientId',
			type: 'hidden',
			default: '',
		},
		{
			displayName: 'Client Secret',
			name: 'clientSecret',
			type: 'hidden',
			default: '',
		},
		{
			displayName: 'Scope',
			name: 'scope',
			type: 'hidden',
			default: '',
		},
		{
			displayName: 'Authorization URL',
			name: 'authUrl',
			type: 'hidden',
			required: true,
			default: `={{ $self["environment"] === "sandbox" ? "https://nhanh.vn/oauth" : "https://nhanh.vn/oauth" }}`,
		},
		{
			displayName: 'Access Token URL',
			name: 'accessTokenUrl',
			type: 'hidden',
			required: true,
			default:
				'={{ $self["environment"] === "sandbox" ? "https://nhanh.vn/oauth/access_token" : "https://nhanh.vn/oauth/access_token" }}',
		},
		{
			displayName: 'Grant Type',
			name: 'grantType',
			type: 'hidden',
			default: 'authorizationCode',
		},
		{
			displayName: 'Authentication',
			name: 'authentication',
			type: 'hidden',
			default: 'body',
		},
		{
			displayName: 'Auth URI Query Parameters',
			name: 'authQueryParameters',
			type: 'string',
			required: false,
			default: '',
			description: '',
		},
	];
}

Hi @Hungnpv, you can simply combine them using & (like you would in the full URL). For example:

This would send all parameters to the receiving server:

image

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.