1
1
mirror of https://github.com/n8n-io/n8n.git synced 2024-08-16 16:40:30 +03:00

Add OAuth2 with new grant type to Twitter

This commit is contained in:
agobrech 2023-05-23 16:46:16 +02:00
parent 40eabb454a
commit 1c3b331aa1
2 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,54 @@
import type { ICredentialType, INodeProperties } from 'n8n-workflow';
export class TwitterOAuth2Api implements ICredentialType {
name = 'twitterOAuth2Api';
extends = ['oAuth2Api'];
displayName = 'Twitter OAuth2 API';
documentationUrl = 'twitter';
properties: INodeProperties[] = [
{
displayName: 'Request Token URL',
name: 'requestTokenUrl',
type: 'hidden',
default: 'https://api.twitter.com/oauth/request_token',
},
{
displayName: 'Authorization URL',
name: 'authUrl',
type: 'hidden',
default: 'https://api.twitter.com/oauth/authorize',
},
{
displayName: 'Access Token URL',
name: 'accessTokenUrl',
type: 'hidden',
default: 'https://api.twitter.com/oauth/access_token',
},
{
displayName: 'Signature Method',
name: 'signatureMethod',
type: 'hidden',
default: 'HMAC-SHA1',
},
{
displayName: 'Grant Type',
name: 'grantType',
type: 'hidden',
options: [
{
name: 'Authorization Code',
value: 'authorizationCode',
},
{
name: 'Authorization Code with PKCE',
value: 'pkce',
},
],
default: 'authorizationCode',
},
];
}

View File

@ -315,6 +315,7 @@
"dist/credentials/TwilioApi.credentials.js",
"dist/credentials/TwistOAuth2Api.credentials.js",
"dist/credentials/TwitterOAuth1Api.credentials.js",
"dist/credentials/TwitterOAuth2Api.credentials.js",
"dist/credentials/TypeformApi.credentials.js",
"dist/credentials/TypeformOAuth2Api.credentials.js",
"dist/credentials/UnleashedSoftwareApi.credentials.js",