Microsoft Search Drive Items

About

Microsoft Search Drive Items backend uses the Graph APIto:

  • Send search queries to Microsoft 365
  • Receive files stored in SharePoint or OneDrive

Set Azure Active Directory Authentication

Set authentication to Azure Active Directory in SmartHub as described here: Azure Active Directory Authentication.

Application Permissions

The Client ID specified in Azure Active Directory Authentication must belong to an application with the following permissions:

  • Azure Active Directory Graph
    • User.Read
  • Microsoft Graph
    • Files.Read
    • Files.Read.All


 

How to Add the Microsoft Search Drive Items Backend to SmartHub

Use the following instructions to add the Microsoft Search Drive Items backend to SmartHub:

  1. Navigate to the SmartHub Administration page:http(s)://[web-app-url]/_admin

  2. ClickAdd New Backend.

  3. The backend dialogue box appears.

  4. Backend Name: Enter a backend name.

  5. Backend type: Select the backend type "MSSearchDriveItemsBackend".

  6. Graph Url:
    1. Example:https://graph.microsoft.com/

  7. Authentication
    1. Impersonate set to enabled
      1. Security trims the results using the current user running the search
    2. Impersonate set to disabled
      1. Client Id: Enter the Application ID from Azure App Registrations.
      2. Client Secret: Enter the Key's value from Azure App Registrations.
      3. Microsoft Login Endpoint: Example:https://login.microsoftonline.com
      4. Access Token: Enter the access token from SmartHub's OAuth page.
      5. Refresh Token: Enter the refresh token from SmartHub's OAuth page.

Note: To get the Access and Refresh tokens, the "Authorize" button must be clicked, but all the above fields must be completed (GraphUrl, ClientId, ClientSecret, MicrosoftLoginEndpoint).

      8. Click OK.

How to Register an App in Azure and Configure It

If you use SmartHub with Azure Active Directory authentication you can reuse the same App and jump to step 5.

  1. Navigate to portal.azure.comand log in.

  2. From the left side menu go to Azure Active Directory → App registrations → New registration
    • Name: Enter the name of the application.
    • Application type: Select Web app / API.
    • Sign-on URL: Enter the SmartHub's URL.



  3. Select API Permissions to open the settings menu panel.

  4. Click Add a Permission.

  5. Select APIs my organization uses and add the following permissions (as you type the name, it appears):
    1. Azure Active Directory Graph
      • User.Read
    2. Microsoft Graph
      • Calendars.Read.All
      • Files.Read.All
      • Files.ReadWrite.All
      • Sites.Read.All
      • Sites.ReadWrite.All

     

  6. Click Certificates & secrets>New client secret to generate a client secret key.

  7. In the window that appears (shown below) enter the following information.
    1. Description: Enter a name for the client secret. (Note: The name is your client secret).
    2. Expires: Select the period until expires



    3. A Value is generated after you clickAdd.

Metadata

The following metadata is available for your results:

  • rank
  • summary
  • @odata.type
  • lastModifiedDateTime
  • createdDateTime
  • webUrl
  • createdBy
  • name
  • size
  • lastModifiedBy

Note: For some types, not all metadata is available

Limitations

Date refiners are not supported by the Microsoft Search Drive Items backend