2023-07-31 01:26:38 -07:00
|
|
|
import type {
|
|
|
|
IAuthenticateGeneric,
|
|
|
|
ICredentialTestRequest,
|
|
|
|
ICredentialType,
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
|
|
|
export class OktaApi implements ICredentialType {
|
|
|
|
name = 'oktaApi';
|
|
|
|
|
|
|
|
displayName = 'Okta API';
|
|
|
|
|
2023-08-09 06:16:11 -07:00
|
|
|
documentationUrl = 'okta';
|
|
|
|
|
2024-06-06 04:34:30 -07:00
|
|
|
icon = { light: 'file:icons/Okta.svg', dark: 'file:icons/Okta.dark.svg' } as const;
|
2023-07-31 01:26:38 -07:00
|
|
|
|
2023-11-13 03:11:16 -08:00
|
|
|
httpRequestNode = {
|
|
|
|
name: 'Okta',
|
|
|
|
docsUrl: 'https://developer.okta.com/docs/reference/',
|
|
|
|
apiBaseUrl: '',
|
|
|
|
};
|
|
|
|
|
2023-07-31 01:26:38 -07:00
|
|
|
properties: INodeProperties[] = [
|
|
|
|
{
|
|
|
|
displayName: 'URL',
|
|
|
|
name: 'url',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
placeholder: 'https://dev-123456.okta.com',
|
|
|
|
},
|
|
|
|
{
|
2024-08-12 08:49:06 -07:00
|
|
|
displayName: 'Access Token',
|
2023-07-31 01:26:38 -07:00
|
|
|
name: 'accessToken',
|
|
|
|
type: 'string',
|
|
|
|
typeOptions: { password: true },
|
|
|
|
required: true,
|
|
|
|
default: '',
|
2024-08-12 08:49:06 -07:00
|
|
|
description: 'Secure Session Web Service Access Token',
|
2023-07-31 01:26:38 -07:00
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
authenticate: IAuthenticateGeneric = {
|
|
|
|
type: 'generic',
|
|
|
|
properties: {
|
|
|
|
headers: {
|
|
|
|
Authorization: '=SSWS {{$credentials.accessToken}}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
test: ICredentialTestRequest = {
|
|
|
|
request: {
|
|
|
|
baseURL: '={{$credentials.url}}',
|
|
|
|
url: '/api/v1/api-tokens',
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|