Toggle menu

SharePoint Worker

The SharePoint worker handles the transfer of files and metadata between SharePoint and the File Store worker.

Worker Configuration Properties

As well as the standard properties set in the API Server configuration file, the SharePoint worker requires authentication details to be set.

NameTypeDescription
sharepointAuthDetailsArray <objects>One or more authDetails objects, described below

Authentication

To authenticate with a SharePoint server you must set at least one provider in the sharepointAuthDetails worker configuration object.

When you make a request to the worker you can specify the identifier and authType of one of the objects in this array. Requests that do not contain these properties will use the authDetails marked as the default .

For example, given the three configured providers in the configuration example below, if you were to add the following parameters to your request, it would use the username, password, baseUrl, and domain from the first option in the worker configuration options (NTLMTest - NTLM).

"authDetails": {
    "identifier": "NTLMTest",
    "authType": "NTLM"
}

If you didn't supply any authDetails in your request then it will attempt to use one that is marked as default, in this case the AppOnlyTest - APPONLY.

The three supported types have the following properties:

SAML

NameTypeDescription
identifierString, requiredThe identifier of the authDetails. This along with the authType makes up the unique identifier for these authDetails
authTypeString, required"SAML" for this authType
usernameString, requiredThe username used to authenticate with SharePoint
passwordString, requiredThe password used to authenticate with SharePoint
baseUrlString, requiredThe base url of the SharePoint server. You should also include the specific site, eg https://example.sharepoint.com/sites/test/Goss/
defaultBoolean, optionalIf true then requests to the worker that do not contain authDetails will use these details

NTLM

NameTypeDescription
identifierString, requiredThe identifier of the authDetails. This along with the authType makes up the unique identifier for these authDetails
authTypeString, required"NTLM" for this authType
usernameString, requiredThe username used to authenticate with SharePoint
passwordString, requiredThe username used to authenticate with SharePoint
baseUrlString, requiredThe base url of the SharePoint server. You should also include the specific site. e.g. https://example.sharepoint.com/sites/test/Goss/
defaultBoolean, optionalIf true then requests to the worker that do not contain authDetails will use these details
domainString, optionalThe domain of the account used to authenticate with SharePoint. Either domain or workstation must be set
workstationString, optionalThe workstation of the account used to authenticate with SharePoint. Either domain or workstation must be set

APPONLY

NameTypeDescription
identifierString, requiredThe identifier of the authDetails. This along with the authType makes up the unique identifier for these authDetails
authTypeString, required"APPONLY" for this authType
clientIdString, requiredThe client Id used to authenticate with SharePoint. More information about where to generate the client Id can be found at https://github.com/s-KaiNet/node-sp-auth/wiki/SharePoint-Online-addin-only-authentication
clientSecretString, requiredThe client secret used to authenticate with SharePoint. More information about where to generate the client secret can be found at https://github.com/s-KaiNet/node-sp-auth/wiki/SharePoint-Online-addin-only-authentication
baseUrlString, requiredThe base url of the SharePoint server. You should also include the specific site. e.g. https://example.sharepoint.com/sites/test/Goss/
defaultBoolean, optionalIf true then requests to the worker that do not contain authDetails will use these details

Example Configuration

{
    "name": "sharepoint",
    "instances": 1,
    "sharepointAuthDetails": [{
            "identifier": "NTLMTest",
            "authType": "NTLM",
            "username": "myusername",
            "password": "mypassword",
            "domain": "goss",
            "baseUrl": "https://example.sharepoint.com/sites/tst/test/"
        },
        {
            "identifier": "SAMLTest",
            "authType": "SAML",
            "username": "myusername",
            "password": "mypassword",
            "baseUrl": "https://example.sharepoint.com/sites/tst/test/"
        },
        {
            "identifier": "AppOnlyTest",
            "authType": "APPONLY",
            "clientId": "THECLIENTID",
            "clientSecret": "THECLIENTSECRET",
            "baseUrl": "https://example.sharepoint.com/sites/tst/test/",
            "default": true
        }
    ]
}

API

Share this page

Facebook icon Twitter icon email icon

Print

print icon