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:
Ricardo Espinoza
2022-06-14 01:27:19 -04:00
committed by GitHub
parent 51663c1fcb
commit e29c5975e1
55 changed files with 417 additions and 13 deletions

View File

@@ -299,9 +299,17 @@ export default mixins(showMessage, nodeHelpers).extend({
},
isOAuthType(): boolean {
return !!this.credentialTypeName && (
['oAuth1Api', 'oAuth2Api'].includes(this.credentialTypeName) ||
this.parentTypes.includes('oAuth1Api') ||
this.parentTypes.includes('oAuth2Api')
(
(
this.credentialTypeName === 'oAuth2Api' ||
this.parentTypes.includes('oAuth2Api')
) && this.credentialData.grantType === 'authorizationCode'
)
||
(
this.credentialTypeName === 'oAuth1Api' ||
this.parentTypes.includes('oAuth1Api')
)
);
},
isOAuthConnected(): boolean {