Connecting to Sharepoint (for IT)
This document outlines the steps required to establish a secure connection between Wisq and your SharePoint environment. We've designed this process to be flexible and work within your organization's security requirements.
Steps:
- Create and register your Microsoft EntraID Application
- Configure the correct permissions and sites to share
- Set up the document labeling mechanisms
- Finalize the connection in Wisq
Create and register your EntraID Application
Register a new app
- Log in as an admin to the Azure portal: https://portal.azure.com
- Search for ‘App registrations’
- Click “New registration” to register an application
- Name: Wisq-Sharepoint
- Support account types: single tenant only
- Redirect URL: empty
- Click ‘Register’
Generate a client secret for this app
- Under the ‘Manage’ tab, click ‘Certificates & secrets’
- Click ‘new client secret’
- Description: Wisq app
- Expires: Maximum time available (730 days)
- Click ‘Add’
- Copy the client secret to be shared with Wisq shortly.
Configure the correct permissions
Setting app permissions
- Open the app and click the ‘Manage’ tab
- Click ‘API permissions’
- Click ‘Add a permission’. There are two permissions needed to be granted: Microsoft Graph (site access) and Office 365 Management APIs (activity tracking)
- Microsoft Graph:
- Search and click on Microsoft Graph
- Select ‘Application permissions’ as the type of permission to grant
- Search for and select ‘Sites.Selected’
- Search for and select ‘Group.Read.All’
- Click ‘Add permissions’
- Office 365 Management APIs
- Search and click on Office 365 Management APIs
- Select ‘Application permissions’ as the type of permission to grant
- Search for and select ‘ActivityFeed.Read’
- Click ‘Add permissions
- Microsoft Graph:
- Return to your applications permissions table and select ‘Grant admin consent for [tenant name]’
Selecting the sites to share with Wisq
In order to grant the newly created Wisq-Sharepoint app access to specific sites, an app with site wide admin permissions must be used. Please assign permission Sites.FullControll.All to this admin app. You will then need a client_id and client_secret from that admin app.
Getting the access_token
- The following curl command will return the access_token for the admin app:
- tenant_id, client_id, client_secret
| curl --location 'https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token' --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'grant_type=client_credentials' --data-urlencode 'scope=https://graph.microsoft.com/.default' --data-urlencode 'client_id={client_id}' --data-urlencode 'client_secret={client_secret}' |
Getting the site_id
- The following curl command will return the site_id using the admin app:
- site_hostname, site_name, access_token
| curl --location 'https://graph.microsoft.com/v1.0/sites/{site_hostname}:/sites/{site_name}?=' \ --header 'Authorization: {access_token}' |
Granting site access
- The following command needs to be run for each site shared with Wisq.
|
curl --location --request POST 'https://graph.microsoft.com/v1.0/sites/{site_id}/permissions' \ --header 'Content-Type: application/json' \ --header 'Authorization: {access_token} \ --data '{ "roles": ["read"], "grantedToIdentities": [{ "application": { "id": "{wisq-app-client-id}", "displayName": "{wisq-app-display-name}" } }] }' |
Setting up a document labeling mechanism
After access is granted, the next step is to provide a mechanism for your HR team to select which folders, documents, or pages within each site Wisq should track.
There are two labeling mechanisms that need to be set up: a site column and a security group.
Site columns will be used to label documents while security groups are used to label pages (.aspx files).
Creating a Site Column label
- Log in to Sharepoint.
- Head over to the Site that is shared with Wisq.
- Click the ‘Document’ or ‘Pages’ tab (this may differ for your Sharepoint set up)
- In the table, select ‘Add column’
- Select ‘Yes/No’ and ‘Next’
- Create the column:
- Name: ShareWithWisq
- Description: Label for files shared with Wisq
- Type: Yes/no
- Default value: No
- Copy the Name of the site column to be shared with Wisq shortly.
Creating a Security Group
- Log in as an admin to the Azure portal: https://portal.azure.com
- Search for Groups
- Click ‘New group’
- Group Type: Security
- Group name : ShareWithWisq
- Group description: Label for .aspx files shared with Wisq
- Membership Type: Assigned
- Owners: Add IT as the owner of the group
- Members: empty
Finalize the connection in Wisq
- Log in to Wisq
- Select your profile in the bottom left
- Click on ‘Admin console’
- Select ‘Configure’ on the left side panel
- Select ‘Integrations’
- Select ‘Sharepoint’
- Create a new connection. You will need the following:
- Tenant ID
- Client ID
- Client Secret
- Site URL(s)
- Site Column Name
- Security Group Name
- Security Group ID
- Fill out the fields and select ‘Connect’
After success, Wisq will connect and sync to the files, folders, and pages labeled with your site column and security group.