2022-07-24 08:36:17 -07:00
|
|
|
import { ICredentialType, INodeProperties } from 'n8n-workflow';
|
2020-03-13 18:22:36 -07:00
|
|
|
|
|
|
|
export class GoogleOAuth2Api implements ICredentialType {
|
|
|
|
name = 'googleOAuth2Api';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2022-07-24 08:36:17 -07:00
|
|
|
extends = ['oAuth2Api'];
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2020-03-13 18:22:36 -07:00
|
|
|
displayName = 'Google OAuth2 API';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2022-10-20 08:52:03 -07:00
|
|
|
documentationUrl = 'google/oauth-generic/';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2021-09-11 01:15:36 -07:00
|
|
|
icon = 'file:Google.svg';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2021-06-12 09:39:55 -07:00
|
|
|
properties: INodeProperties[] = [
|
2022-06-13 22:27:19 -07:00
|
|
|
{
|
|
|
|
displayName: 'Grant Type',
|
|
|
|
name: 'grantType',
|
|
|
|
type: 'hidden',
|
|
|
|
default: 'authorizationCode',
|
|
|
|
},
|
2020-03-13 18:22:36 -07:00
|
|
|
{
|
|
|
|
displayName: 'Authorization URL',
|
|
|
|
name: 'authUrl',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'hidden',
|
2020-03-13 18:22:36 -07:00
|
|
|
default: 'https://accounts.google.com/o/oauth2/v2/auth',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Access Token URL',
|
|
|
|
name: 'accessTokenUrl',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'hidden',
|
2020-03-13 18:22:36 -07:00
|
|
|
default: 'https://oauth2.googleapis.com/token',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Auth URI Query Parameters',
|
|
|
|
name: 'authQueryParameters',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'hidden',
|
2020-09-17 14:10:13 -07:00
|
|
|
default: 'access_type=offline&prompt=consent',
|
2020-03-13 18:22:36 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Authentication',
|
|
|
|
name: 'authentication',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'hidden',
|
2020-03-13 18:22:36 -07:00
|
|
|
default: 'body',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
}
|