2020-01-01 22:51:23 -08:00
|
|
|
import {
|
2020-01-07 16:29:11 -08:00
|
|
|
ICredentialType,
|
|
|
|
NodePropertyTypes,
|
2020-01-01 22:51:23 -08:00
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
|
|
|
|
|
|
|
export class OAuth2Api implements ICredentialType {
|
2020-01-07 16:29:11 -08:00
|
|
|
name = 'oAuth2Api';
|
|
|
|
displayName = 'OAuth2 API';
|
|
|
|
properties = [
|
|
|
|
{
|
|
|
|
displayName: 'Authorization URL',
|
|
|
|
name: 'authUrl',
|
|
|
|
type: 'string' as NodePropertyTypes,
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Access Token URL',
|
|
|
|
name: 'accessTokenUrl',
|
|
|
|
type: 'string' as NodePropertyTypes,
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Client ID',
|
|
|
|
name: 'clientId',
|
|
|
|
type: 'string' as NodePropertyTypes,
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Client Secret',
|
|
|
|
name: 'clientSecret',
|
|
|
|
type: 'string' as NodePropertyTypes,
|
|
|
|
typeOptions: {
|
|
|
|
password: true,
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Scope',
|
|
|
|
name: 'scope',
|
|
|
|
type: 'string' as NodePropertyTypes,
|
|
|
|
default: '',
|
|
|
|
},
|
2020-02-08 16:14:28 -08:00
|
|
|
{
|
|
|
|
displayName: 'Auth URI Query Parameters',
|
|
|
|
name: 'authQueryParameters',
|
|
|
|
type: 'string' as NodePropertyTypes,
|
|
|
|
default: '',
|
|
|
|
description: 'For some services additional query parameters have to be set which can be defined here.',
|
|
|
|
placeholder: 'access_type=offline',
|
|
|
|
},
|
2020-01-07 16:29:11 -08:00
|
|
|
];
|
2020-01-01 22:51:23 -08:00
|
|
|
}
|