Configuration and Administration

Setup for Using SharePoint with OTM

Oracle Transportation Management (OTM) can use Microsoft SharePoint Online, hosted on Azure Cloud, as an external data storage system to store documents as part of content management system (CMS).

This page briefly describes the steps performed to connect to Microsoft SharePoint Online using Microsoft Graph API.

First of all, you need to register the application in the Azure Active Directory (AAD) portal. OTM will communicate with SharePoint Online by means of this application.

Once the application is registered, you will have to configure a Client Secret for the application which will be used for authentication purposes.

This can be achieved by creating a new Client Secret under "Certificates and Secrets" in the Azure Active Directory (AAD)  portal .

You will also have to provide adequate permissions to the newly registered application so that the Microsoft Graph API calls work.

This can be achieved via API Permissions > Add a Permission > Microsoft Graph, and then selecting the required permissions from "Delegated Permissions" and "Application Permissions".

Once the permissions are granted, the application is ready for use. You will have the following details generated once the application is registered:

  • Application (client) ID
  • Directory (tenant) ID
  • Secret Value (obtained while creating the Client Secret)

These will be required for the next steps where you will configure OTM to work with SharePoint Online.

Setting Up an External System In OTM

You will be required to configure an external system in OTM that will enable you to authenticate/interact with SharePoint Online.

The input fields should be set as follows:

  • Authentication Type: OAuth 2.0 - Client Credentials
  • Authorization Service Authentication Type: Microsoft Graph API
  • Client ID: Provide the Application (client) ID value generated after registering the application
  • Client Secret: Provide the Secret Value generated after registering the application
  • Authorization Service URL: https://login.microsoftonline.com/{Directory (tenant) ID}/oauth2/v2.0/token (replace {Directory (tenant) ID} with the actual value)
  • Application Scope: https://graph.microsoft.com/.default
  • URL: https://graph.microsoft.com/v1.0/drives (acts as  a base URL for all API requests)

Setting Up Content Management  System In OTM

You have to configure a Content Management System (CMS) in OTM for SharePoint Online.

The input fields should be set as follows:

  • System Type: SharePoint Online
  • External System: Select the External System created in the above section
  • Drive ID: This represents the location where the documents will be stored . The drive ID to be used can be obtained by means of an API call. Microsoft Graph provides certain ways to obtain the drive ID. You can refer to Microsoft documentation for Microsoft Graph APIs (Microsoft Graph >  v1.0 reference >  Files > Drives >  Get drive) to check for the various ways to obtain the drive ID.
    Following is one such way:
    1. Obtain the OAuth token: You need to obtain an authentication token which will be used in API request to fetch the drive ID.

Request:

curl -X POST "https://login.microsoftonline.com/{Directory (tenant) ID}/oauth2/v2.0/token" -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=client_credentials&client_id={Application (client) ID}&client_secret={Secret Value}&scope=https://graph.microsoft.com/.default


Response
:

{

"token_type":"Bearer",

"expires_in":3599,

"ext_expires_in":3599,

"access_token":"abcdef123"

}

Note: Replace {Directory (tenant) ID}, {Application (client) ID}, and {Secret Value} with actual values.

    1. Make API call to obtain drive ID: Now you will have to make the API call to fetch the  drive using the access_token that you obtained in the previous step.

Request:

curl -X GET "https://graph.microsoft.com/v1.0/drives" -H "Content-Type: application/json" -H "Authorization: Bearer abcdef123"


Response
:

{

"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#drives",

"value":[

{

"createdDateTime":"2019-11-17T07:53:03Z",

"description":"",

"id":"j!33fffsdtyaouwwbnbcypdhdhddhhhddjdjkkak",

"lastModifiedDateTime":"2021-08-17T21:47:34Z",

"name":"Documents",

"webUrl":"https://abc.sharepoint.com/someLocation",

"driveType":"documentLibrary",

"createdBy":{

"user":{

"displayName":"System Account"

}

},

"lastModifiedBy":{

"user":{

"email":"xyz@abc.onmicrosoft.com",

"displayName":"ABC XYZ"

}

},

"owner":{

"group":{

"id":"************************",

"displayName":""

}

},

"quota":{

"deleted":67680990,

"remaining":27487671942107,

"state":"normal",

"total":27487790694400,

"used":48729447

}

}

]

}

Here the value of "id" parameter in response "j!33fffsdtyaouwwbnbcypdhdhddhhhddjdjkkak" denotes the Drive ID.

Related Topics

External System

Content Management System