diff --git a/packages/nodes-base/credentials/MicrosoftOAuth2Api.credentials.ts b/packages/nodes-base/credentials/MicrosoftOAuth2Api.credentials.ts index 9a6b77efb9..5ee8432f54 100644 --- a/packages/nodes-base/credentials/MicrosoftOAuth2Api.credentials.ts +++ b/packages/nodes-base/credentials/MicrosoftOAuth2Api.credentials.ts @@ -18,8 +18,9 @@ export class MicrosoftOAuth2Api implements ICredentialType { type: 'hidden', default: 'authorizationCode', }, - //info about the tenantID - //https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-protocols#endpoints + // Info about the tenantID + // https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-protocols#endpoints + // Endpoints `/common` can only be used for multitenant apps { displayName: 'Authorization URL', name: 'authUrl', diff --git a/packages/nodes-base/credentials/MicrosoftSharePointOAuth2Api.credentials.ts b/packages/nodes-base/credentials/MicrosoftSharePointOAuth2Api.credentials.ts new file mode 100644 index 0000000000..d8243627f5 --- /dev/null +++ b/packages/nodes-base/credentials/MicrosoftSharePointOAuth2Api.credentials.ts @@ -0,0 +1,38 @@ +import type { Icon, ICredentialType, INodeProperties } from 'n8n-workflow'; + +export class MicrosoftSharePointOAuth2Api implements ICredentialType { + name = 'microsoftSharePointOAuth2Api'; + + extends = ['microsoftOAuth2Api']; + + icon: Icon = { + light: 'file:icons/SharePoint.svg', + dark: 'file:icons/SharePoint.svg', + }; + + displayName = 'Microsoft SharePoint OAuth2 API'; + + documentationUrl = 'microsoft'; + + httpRequestNode = { + name: 'Microsoft SharePoint', + docsUrl: 'https://learn.microsoft.com/en-us/sharepoint/dev/apis/sharepoint-rest-graph', + apiBaseUrlPlaceholder: 'https://{subdomain}.sharepoint.com/_api/v2.0/', + }; + + properties: INodeProperties[] = [ + { + displayName: 'Scope', + name: 'scope', + type: 'hidden', + default: '=openid offline_access https://{{$self.subdomain}}.sharepoint.com/.default', + }, + { + displayName: 'Subdomain', + name: 'subdomain', + type: 'string', + default: '', + hint: 'You can extract the subdomain from the URL. For example, in the URL "https://tenant123.sharepoint.com", the subdomain is "tenant123".', + }, + ]; +} diff --git a/packages/nodes-base/credentials/icons/SharePoint.svg b/packages/nodes-base/credentials/icons/SharePoint.svg new file mode 100644 index 0000000000..8baca49105 --- /dev/null +++ b/packages/nodes-base/credentials/icons/SharePoint.svg @@ -0,0 +1,59 @@ + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 88ae4605b6..46c2299f45 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -225,6 +225,7 @@ "dist/credentials/MicrosoftOAuth2Api.credentials.js", "dist/credentials/MicrosoftOneDriveOAuth2Api.credentials.js", "dist/credentials/MicrosoftOutlookOAuth2Api.credentials.js", + "dist/credentials/MicrosoftSharePointOAuth2Api.credentials.js", "dist/credentials/MicrosoftSql.credentials.js", "dist/credentials/MicrosoftTeamsOAuth2Api.credentials.js", "dist/credentials/MicrosoftToDoOAuth2Api.credentials.js",