mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(HTTP Request Node): fix oauth credentials not working properly for some predefined credentials (#4277)
This commit is contained in:
committed by
GitHub
parent
a2a397e980
commit
aa6c786041
@@ -1,4 +1,4 @@
|
||||
import { INodeExecutionData } from 'n8n-workflow';
|
||||
import { INodeExecutionData, IOAuth2Options } from 'n8n-workflow';
|
||||
|
||||
export const replaceNullValues = (item: INodeExecutionData) => {
|
||||
if (item.json === null) {
|
||||
@@ -6,3 +6,65 @@ export const replaceNullValues = (item: INodeExecutionData) => {
|
||||
}
|
||||
return item;
|
||||
};
|
||||
|
||||
export const getOAuth2AdditionalParameters = (nodeCredentialType: string) => {
|
||||
const oAuth2Options: { [credentialType: string]: IOAuth2Options } = {
|
||||
bitlyOAuth2Api: {
|
||||
tokenType: 'Bearer',
|
||||
},
|
||||
boxOAuth2Api: {
|
||||
includeCredentialsOnRefreshOnBody: true,
|
||||
},
|
||||
ciscoWebexOAuth2Api: {
|
||||
tokenType: 'Bearer',
|
||||
},
|
||||
clickUpOAuth2Api: {
|
||||
keepBearer: false,
|
||||
tokenType: 'Bearer',
|
||||
},
|
||||
goToWebinarOAuth2Api: {
|
||||
tokenExpiredStatusCode: 403,
|
||||
},
|
||||
hubspotDeveloperApi: {
|
||||
tokenType: 'Bearer',
|
||||
includeCredentialsOnRefreshOnBody: true,
|
||||
},
|
||||
hubspotOAuth2Api: {
|
||||
tokenType: 'Bearer',
|
||||
includeCredentialsOnRefreshOnBody: true,
|
||||
},
|
||||
lineNotifyOAuth2Api: {
|
||||
tokenType: 'Bearer',
|
||||
},
|
||||
linkedInOAuth2Api: {
|
||||
tokenType: 'Bearer',
|
||||
},
|
||||
mailchimpOAuth2Api: {
|
||||
tokenType: 'Bearer',
|
||||
},
|
||||
mauticOAuth2Api: {
|
||||
includeCredentialsOnRefreshOnBody: true,
|
||||
},
|
||||
microsoftDynamicsOAuth2Api: {
|
||||
property: 'id_token',
|
||||
},
|
||||
philipsHueOAuth2Api: {
|
||||
tokenType: 'Bearer',
|
||||
},
|
||||
raindropOAuth2Api: {
|
||||
includeCredentialsOnRefreshOnBody: true,
|
||||
},
|
||||
shopifyOAuth2Api: {
|
||||
tokenType: 'Bearer',
|
||||
keyToIncludeInAccessTokenHeader: 'X-Shopify-Access-Token',
|
||||
},
|
||||
slackOAuth2Api: {
|
||||
tokenType: 'Bearer',
|
||||
property: 'authed_user.access_token',
|
||||
},
|
||||
stravaOAuth2Api: {
|
||||
includeCredentialsOnRefreshOnBody: true,
|
||||
},
|
||||
};
|
||||
return oAuth2Options[nodeCredentialType];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user