@n8n/n8n-nodes-langchain
Version:
141 lines • 5.82 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AzureEntraCognitiveServicesOAuth2Api = void 0;
const defaultScopes = ['openid', 'offline_access'];
class AzureEntraCognitiveServicesOAuth2Api {
constructor() {
this.name = 'azureEntraCognitiveServicesOAuth2Api';
this.displayName = 'Microsoft Foundry (Entra ID)';
this.extends = ['oAuth2Api'];
this.documentationUrl = 'https://docs.n8n.io/integrations/builtin/credentials/azureopenai/#using-azure-entra-id-oauth2';
this.properties = [
{
displayName: 'Grant Type',
name: 'grantType',
type: 'hidden',
default: 'clientCredentials',
},
{
displayName: 'Endpoint Type',
name: 'endpointType',
type: 'options',
options: [
{ name: 'Classic', value: 'classic' },
{ name: 'Microsoft Foundry', value: 'foundry' },
],
default: 'classic',
description: 'Classic targets *.openai.azure.com (resource name + deployment-based URLs). Microsoft Foundry targets *.services.ai.azure.com/openai/v1 (full endpoint URL).',
},
{
displayName: 'Resource Name',
name: 'resourceName',
type: 'string',
required: true,
default: '',
displayOptions: { show: { endpointType: ['classic'] } },
},
{
displayName: 'API Version',
name: 'apiVersion',
type: 'string',
required: true,
default: '2025-03-01-preview',
displayOptions: { show: { endpointType: ['classic'] } },
},
{
displayName: 'Endpoint',
name: 'foundryEndpoint',
type: 'string',
required: true,
default: '',
placeholder: 'https://<resource>.services.ai.azure.com/openai/v1',
displayOptions: { show: { endpointType: ['foundry'] } },
hint: 'The full Microsoft Foundry OpenAI-compatible base URL.',
},
{
displayName: 'Project',
name: 'project',
type: 'string',
default: '',
displayOptions: { show: { endpointType: ['foundry'] } },
description: 'Optional. The Microsoft Foundry project that owns your deployments. n8n uses it to list the deployments. The project overview page in the Foundry portal shows the name.',
},
{
displayName: 'Endpoint',
name: 'endpoint',
type: 'string',
default: undefined,
placeholder: 'https://<resource>.openai.azure.com',
displayOptions: { show: { endpointType: ['classic'] } },
hint: 'Optional. Defaults to https://<resourceName>.openai.azure.com.',
},
{
displayName: 'Tenant ID',
name: 'tenantId',
type: 'string',
required: true,
default: '',
description: 'The Directory (tenant) ID of the Entra app registration',
placeholder: 'e.g. xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
},
{
displayName: 'Authorization URL',
name: 'authUrl',
type: 'hidden',
default: '=https://login.microsoftonline.com/{{$self["tenantId"]}}/oauth2/authorize',
},
{
displayName: 'Access Token URL',
name: 'accessTokenUrl',
type: 'hidden',
default: '=https://login.microsoftonline.com/{{$self["tenantId"]}}/oauth2/token',
},
{
displayName: 'Send Additional Body Properties',
name: 'sendAdditionalBodyProperties',
type: 'hidden',
default: false,
},
{
displayName: 'Additional Body Properties',
name: 'additionalBodyProperties',
type: 'hidden',
default: '{"grant_type": "client_credentials", "resource": "https://cognitiveservices.azure.com/"}',
},
{
displayName: 'Authentication',
name: 'authentication',
type: 'hidden',
default: 'body',
},
{
displayName: 'Custom Scopes',
name: 'customScopes',
type: 'hidden',
default: false,
},
{
displayName: 'Auth URI Query Parameters',
name: 'authQueryParameters',
type: 'hidden',
default: '',
description: 'For some services additional query parameters have to be set which can be defined here',
placeholder: '',
},
{
displayName: 'Enabled Scopes',
name: 'enabledScopes',
type: 'hidden',
default: defaultScopes.join(' '),
},
{
displayName: 'Scope',
name: 'scope',
type: 'hidden',
default: '={{ $self.customScopes ? $self.enabledScopes : "' + defaultScopes.join(' ') + '"}}',
},
];
}
}
exports.AzureEntraCognitiveServicesOAuth2Api = AzureEntraCognitiveServicesOAuth2Api;
//# sourceMappingURL=AzureEntraCognitiveServicesOAuth2Api.credentials.js.map