Skip to main content

OAuth 2.0 Applications and Storage Setup

For support regarding below, please contact your internal IT department or trusted Business Central partner.

Create Application or Service Principal in MS Entra (or Azure)

Set a Name of choice. Choose: ‘’Accounts in any organizational directory” and then click on ‘’Register’’.

ExFlow SharePoint Setup

After registration, take notes of the “Application (client) ID”.

ExFlow SharePoint Setup

Go under API permissions to add a permission.

ExFlow SharePoint Setup

Click on ‘’Microsoft Graph’’ and ‘’Application Permissions’’.
Search for ‘’site’’ and add permission: Sites.ReadWrite.All

ExFlow SharePoint Setup

Click on ‘’SharePoint’’ and ‘’Application Permissions’’ again.
Select and add both permissions: Sites.ReadWrite.All and Sites.Manage.All.

ExFlow SharePoint Setup

Grant admin consent for these permissions:

ExFlow SharePoint Setup

Permissions should look like this:

ExFlow SharePoint Setup

Go to ‘’Certificates & secrets’’.

ExFlow SharePoint Setup

Create a client secret:

ExFlow SharePoint Setup

Copy the secret and/or save it. The secret will not be visible anymore. If the secret gets forgotten or misplaced, create a new secret and reconfigure the OAuth2 Application.

ExFlow SharePoint Setup

Go back to the list of App registrations and click on Endpoints. Copy both OAuth2.0 v2 Endpoints; Authorization and Token. Also copy Microsoft Graph API endpoint.


ExFlow SharePoint Setup

Completed with Entra or Azure AD or AAD.

Configure an OAuth2 Application in ExFlow

Go to: ExFlow Setup --> Actions --> Functions --> OAuth2 Applications

Start the configuration by clicking on ''New'' to create a new OAuth 2.0 Application.

OAuth 2.0 ApplicationsExFlow SharePoint Setup
Request Access TokenOpen the service authorization web page. Login credentials will be prompted. The authorization code must be copied into the Enter Authorization Code field.
Refresh Access TokenRefresh the access and refresh tokens.

ExFlow SharePoint Setup

General
CodeSpecifies the name of the Code
DescriptionSpecifies the Code description
Application / Client IDSpecifies the Application ID from the Enterprise Application Overview.
Client SecretSpecifies the client secret
Grant TypeSpecifies the grant type to use. It is possible to use Authorization Code, Password Credentials or Client Credentials. Currently only ‘’Client Credentials’’ is supported.
Redirect URLSpecifies the redirect URL, not in use for now.
ScopeSpecifies the scope. Enter the Graph Endpoint and add ‘’.default.’’ Make sure the endpoint looks like the following at the end: ‘’…soft.com/.default’’

Endpoints
Authorization URLSpecifies the authorization URL
Access Token URLSpecifies the access token URL
Auth. URL ParmsSpecifies the resource URL, not in use for now.

Enter all needed setup information. Enter a code and code description. Paste the Application/ Client ID and the Client Secret from MS Entra Admin Center.

Set Grant Type to ''Client Credentials'' and the MS graph scope url (Microsoft Graph API).

ExFlow SharePoint Setup

Under the Endpoint section, paste the previously copied URL's for both OAuth2.0 v2 Authorization Endpoint and Token Endpoint.

Test by pressing “Request Access Token”. Following message should be displayed if everything is correct: “Access Token updated successfully.”

SharePoint Setup

In Site Contents, create a new Document Library, this will contain the folder that ExFlow will store data in. Create a folder in the Document Library that was just created. This will be the location of the documents. Click on the newly created folder. Copy the complete URL from the address field in the browser, this will be needed in the configuration below.

Blob Storage Setup for SharePoint

Go to: ExFlow Setup -- > Actions --> Functions --> Blob Storage Mgmt (ExFlow Storage Management Setup)

Blob Storage Mgmt / ExFlow Storage Management SetupExFlow SharePoint Setup
Storage SetupConfigure one or more storage configurations
Enable/ Disable Blob StorageActivate or inactivate blob storage

From the ExFlow Storage Management Setup page, click on Storage Setup and then on ‘’New’’ to start with the configuration.

ExFlow SharePoint Setup

Enter a Code and Description. For Blob Source, select SharePoint.

Then click Setup Storage to continue the configuration.

ExFlow SharePoint Setup

Copy the URL from SharePoint and paste that into the field ''SharePoint URL''. Once exit the field, values will be extracted and populated into Host, Site, Document Library and Folder. If any of the fields are missing, most likely Folder, it’s possible to enter those manually.

ExFlow SharePoint Setup

Select the previously created OAuth2 Application and verify by clicking on ‘’Connect’’.

If something is wrong like the folder name, message like “Not Found” will appear.

Moreover, if permissions are missing, a message like “Unauthorized” will appear.

If all is OK, the SharePoint Connection Status will be set to ‘’Connected’’ and parameters will be populated in Site Id, Drive Id and List Id.

It is now OK to close this page since the Blob Storage Setup for SharePoint is completed.

Go back to ExFlow Storage Setup for this setup to click on ‘’Enabled’’.

ExFlow SharePoint Setup

Close ExFlow Storage Setup and return to ExFlow Storage Management Setup / Blob Storage Mgmt.

Select the newly created SharePoint setup in “Incoming Doc. Storage Code”.

ExFlow SharePoint Setup

Click on ‘’Active’’ or “Enable / Disable Blob Storage”.

ExFlow SharePoint Setup

If any existing posted invoices approved using ExFlow, a dialog will ask to transfer those, then it’s possible to choose Yes.

It is now possible to check status for posted invoices in Blob Storage by selecting ‘’Actions --> Storage Details’’.

Click on ‘’Sync Storage’’ to force a transfer over to SharePoint.

ExFlow SharePoint Setup

Refresh the SharePoint page with the folder previously created, it should now be possible to view the new folders there.

ExFlow SharePoint Setup