mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
feat(core): Add "Client Credentials" grant type to OAuth2 (#3489)
* ⚡ Add OAuth2 client credentials grant type * ⚡ Improvements * 🐛 Fix linting issue * 🐛 Fix typo * 🐛 Fix small issue with type * 🐛 When token expire get a new one instead of refreshing it * ⚡ Fix issue that it did not display it correctly for OAuth1 Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
@@ -10,10 +10,33 @@ export class OAuth2Api implements ICredentialType {
|
||||
documentationUrl = 'httpRequest';
|
||||
genericAuth = true;
|
||||
properties: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Grant Type',
|
||||
name: 'grantType',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'Authorization Code',
|
||||
value: 'authorizationCode',
|
||||
},
|
||||
{
|
||||
name: 'Client Credentials',
|
||||
value: 'clientCredentials',
|
||||
},
|
||||
],
|
||||
default: 'authorizationCode',
|
||||
},
|
||||
{
|
||||
displayName: 'Authorization URL',
|
||||
name: 'authUrl',
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
grantType: [
|
||||
'authorizationCode',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
required: true,
|
||||
},
|
||||
@@ -51,6 +74,13 @@ export class OAuth2Api implements ICredentialType {
|
||||
displayName: 'Auth URI Query Parameters',
|
||||
name: 'authQueryParameters',
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
grantType: [
|
||||
'authorizationCode',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'For some services additional query parameters have to be set which can be defined here',
|
||||
placeholder: 'access_type=offline',
|
||||
@@ -59,6 +89,13 @@ export class OAuth2Api implements ICredentialType {
|
||||
displayName: 'Authentication',
|
||||
name: 'authentication',
|
||||
type: 'options',
|
||||
displayOptions: {
|
||||
show: {
|
||||
grantType: [
|
||||
'authorizationCode',
|
||||
],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Body',
|
||||
|
||||
Reference in New Issue
Block a user