In "Document Link Setup", we outlined that you may have different options for your File Storage dependant on the version of Clever Document Links you have. Anything Pre-version 2.0 will display 'SharePoint' as an option and requires the App Registration and Client secret to be created in SharePoint. Version 2.0 or later will display this option as 'SharePoint Legacy' but the setup & functionality remain the same.

Using Client Secrets in Azure

If you created your Client Secret in Azure, than when this has expired, a new one can simply be created. 

Click on New Client Secret as above and confirm the expiration period you want this client secret to last for. When this is created, you can delete the old one and copy the Value for the new one. This Value then needs to be pasted into the SharePoint Setup Wizard to ensure the connection is re-established.

 Using Client Secrets in Sharepoint

If you created your Client Secret in SharePoint, by default the expiration date for a client secret is for one year and you will need to use PowerShell (and have the correct permissions to manage your tenant) in order to renew the client secret as there is no web interface available to do so.

Pre-requisites

Within PowerShell you will need to install the AzureAD, for which Administrator permissions will be required, using the following command.

Install-Module AzureAD

Connecting to your Azure Environment

With the AzureAD module installed, you will need to connect to your Azure environment in order to reveal and extend the expiry date of the Document Links SharePoint App, which is done using the following command inside PowerShell.

Connect-AzureAD 

Once connected to the Azure environment on which the Clever Document Links SharePoint App was originally created within, you will need to identify the SharePoint App in order to reveal and/or extend the expiration date. 

Setting the SharePoint App

If you do not remember the name of the SharePoint App used to setup Client Credentials authorisation, you can use the following command to retrieve a list of the Apps within the environment. This will return a list of all Apps on your environment, from which you will need to identify the full name of the Clever Document Links App, e.g. Clever Document Links.

Get-AzureADServicePrincipal -All $true

Once you have the name of the App you will then need to set the App within the PowerShell session, using the following command.

$AppName = "Enter Doc Links App Name here"

Get-AzureADServicePrincipal -All $true |  Where-Object {$_.DisplayName -eq $AppName}

$App = Get-AzureADServicePrincipal -All $true |  Where-Object {$_.DisplayName -eq $AppName}

Reveal and extend the expiration date

If you wish to view the current expiration date the following commands can be used to retrieve and show the expiration date.

$CurrentExpiryDate = (Get-AzureADServicePrincipalPasswordCredential -ObjectId $App.ObjectId).EndDate

Write-host "Current Expiry Date:"$CurrentExpiryDate

To extend the expiration date, the following commands must be used, where it is possible to extend the expiration date by up to 10 years.

$StartDate = Get-Date

$EndDate = $StartDate.AddYears(x)

New-AzureADServicePrincipalPasswordCredential -ObjectId $App.ObjectId -EndDate $EndDate -Value “CurrentClientSecret”

Note: The x in the above should be replaced with a number to represent the number of years by which to extend the expiration date, e.g. 1 would be 1 year.