mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 11:49:59 +00:00
fix(core): Do not add Authentication header when authentication type is body (#8201)
This commit is contained in:
committed by
GitHub
parent
ccb2b076f8
commit
ac1c642fdd
@@ -1,4 +1,4 @@
|
||||
import type { ClientOAuth2Options } from '@n8n/client-oauth2';
|
||||
import type { ClientOAuth2Options, OAuth2CredentialData } from '@n8n/client-oauth2';
|
||||
import { ClientOAuth2 } from '@n8n/client-oauth2';
|
||||
import Csrf from 'csrf';
|
||||
import { Response } from 'express';
|
||||
@@ -7,24 +7,11 @@ import * as qs from 'querystring';
|
||||
import omit from 'lodash/omit';
|
||||
import set from 'lodash/set';
|
||||
import split from 'lodash/split';
|
||||
import type { OAuth2GrantType } from 'n8n-workflow';
|
||||
import { ApplicationError, jsonParse, jsonStringify } from 'n8n-workflow';
|
||||
import { Authorized, Get, RestController } from '@/decorators';
|
||||
import { OAuthRequest } from '@/requests';
|
||||
import { AbstractOAuthController } from './abstractOAuth.controller';
|
||||
|
||||
interface OAuth2CredentialData {
|
||||
clientId: string;
|
||||
clientSecret?: string;
|
||||
accessTokenUrl?: string;
|
||||
authUrl?: string;
|
||||
scope?: string;
|
||||
authQueryParameters?: string;
|
||||
authentication?: 'header' | 'body';
|
||||
grantType: OAuth2GrantType;
|
||||
ignoreSSLIssues?: boolean;
|
||||
}
|
||||
|
||||
interface CsrfStateParam {
|
||||
cid: string;
|
||||
token: string;
|
||||
@@ -226,6 +213,7 @@ export class OAuth2CredentialController extends AbstractOAuthController {
|
||||
clientSecret: credential.clientSecret ?? '',
|
||||
accessTokenUri: credential.accessTokenUrl ?? '',
|
||||
authorizationUri: credential.authUrl ?? '',
|
||||
authentication: credential.authentication ?? 'header',
|
||||
redirectUri: `${this.baseUrl}/callback`,
|
||||
scopes: split(credential.scope ?? 'openid', ','),
|
||||
scopesSeparator: credential.scope?.includes(',') ? ',' : ' ',
|
||||
|
||||
Reference in New Issue
Block a user