Home » Installation & planning of Wizdom infrastructure » Generate a New Client ID and extend Client Secret for SharePoint’s classic experiences
[printicon align="left"]

Generate a New Client ID and extend Client Secret for SharePoint’s classic experiences

When you make a new app request in SharePoint, the client secret is valid for 12 months by default. However, it is possible to extend the period to 3 years by following these steps.

This guide will walk you through how to generate a new Wizdom app with associated client id, and client secret if the client secret has expired. To generate and extend the current client secret from 1 year to 3 years, please follow these steps:

Last edited May 3 2019

Prerequisites

Before you start, you’ll need the following:

1) Microsoft Online Services Sign-In Assistant will have to be installed on the development computer. Download it here (32bit or 64bit)

2) SharePoint Online Management Shell will have to be installed on the development computer. Download it here

3) A tenant administrator user for the Office 365.

4) Script to generate new client secret. Download newclientsecret.zip from Wizdom Partner portal http://bit.ly/2OCFuTX  

 

Generating New Client Secret

Once you’ve made sure that you have everything you need to generate and extend the current client secret from 1 year to 3 years, please follow these steps:

1) Log in to https://portal.azure.com with the <Azure Admin> account

2) Select Resource Groups, and click resource group = <wizdomrg>

3) Click the web app service = <wizdomweb>

4) Select Application Settings

5) Copy existing ClientID and save it in Notepad for later use

Wizdom Digital Workplace

6) Open SharePoint Online Management Shell with elevate rights

7) Run the following cmdlet Connect-MsolService and sign in as Office 365 tenant administrator

8) Change directory to the downloaded script ps1 and run the script

9) At the prompt for client id : enter the current ClientID as documented in step 5

10) The new client secret will appear in the Windows PowerShell console. Copy this to Notepad

Updating the New Client ID and Secret in Azure

Now, you’ll need to update the client id and secret for the Wizdom app in Azure.

1) Go to https://portal.azure.com/ and log in to find the Wizdom Azure website.

2) Log in with the <Azure Admin> account

3) Select Resource Groups, and click resource group = <wizdomrg>

4) Click the web app service = <wizdomweb>

5) Select Application Settings

6) Change the name of the ClientSecret key to SecondaryClientSecret as shown below

Wizdom Digital Workplace

7) Add a new setting and name it ClientSecret and paste in the new value from the previous section, step 10

8) Click Save and restart the web app

9) Login in to Wizdom Intranet and test it working as expected

Deleting the old app from the intranet and the app catalog

Before you can generate and add a new app, that uses the new client id and secret, the old Wizdom app must be deleted. This will have to be done in the relevant site collection as well as in the app catalog.

1) First, go to ‘Site contents’ for the site collection and remove the Wizdom app by clicking the three dots and then REMOVE. It can take a while for the app to be removed.

2) Next click on the Settings menu and select Site Settings

3) In the Site Collection Administration section, select Recycle bin (_layouts/15/AdminRecycleBin.aspx)

4) Select the app and click on Delete Selection 

5) On the same page, click second-stage recycle bin 

6) Finally in the second-stage recycle bin, select the app and click on Delete Selection

7) Now, the app will have to be deleted from the app catalog. Open the app launcher and click the ‘Admin’ icon to go to the Office 365 Admin Center. 

4) From here, click ‘SharePoint’ under ‘Admin centers’ to go to the ‘SharePoint admin center’.
5) In the SharePoint admin center, click ‘apps’ in the left menu and then ‘App Catalog’ to go to the App Catalog.
6) Click ‘Apps for SharePoint’ in the left menu. Here you’ll find a list of SharePoint apps. Find the app that you want to delete (same URL that you filled in the Redirect URL field in step 1.5.), mark it, and press your keyboard’s delete button.

7) Finally, delete the app from the Admin Recycle Bin. 

Creating a new app with PowerShell

Now, you’ll need to create a new Wizdom app.

This is done by running a PowerShell script named ‘GenerateAppPackage.ps1’ and is found in this zipped folder.

1) Download the zip-file and extract the content.

2) To execute the script in the file, in ???program???, first navigate to this folder. To navigate to the folder in ???program??? write: cd ”” (remember double quotes). After this, execute the script as follows:

.\generateAppPackage.ps1 -clientid "<clientid>" -appurl "<appurl>" -outfile <appnavn>.app [–productid "produtid" -title "<title>" -name "<title>"]

3) You replace the parameters with the respective values (the new client id from earlier, app URL (same URL that you filled in the ‘Redirect URL’ field in step 1.5), and app name (same name that you filled in the ‘Title’ field in step 1.3). The three last parameters [i brackets] are optional and only used if more apps have the same name.

To make a new GUID in PowerShell, run the following command:

[guid]::NewGuid()

This command generates an app file in the same folder as the PS1 file.

Uploading the new app to the app catalog

Now, you will upload the app file you’ve just created to the app catalog. This can easily be done by the means of drag and drop.

Check, in the column to the right, that the app is valid.

Adding the new Wizdom app to the Intranet

Finally, you add the app to the site collection where you need the Wizdom functionality.

1) The easiest way to do this is by clicking ‘Add an app’ from the settings wheel.

2) In the left menu of the page, under ‘Apps You Can Add’ click ‘From Your Organization’. Find the new Wizdom app, click on it and click ‘Trust it’.

Test and validate

That’s it!

Now go to the intranet front page and make sure that all Wizdom web parts work. Also, test the Wizdom app by going to Wizdom Configuration Center and confirm that everything work well in there as well.

If you encounter errors, then double-check that you have followed all steps in this guide thoroughly. Optionally, you can try and add the Wizdom app once again or to reinstall the app in the app catalog.

If Wizdom’s web parts still doesn’t work after this, but Wizdom Configuration Center opens and loads correctly, then try and go to the ‘Installation’ module in the ‘Admin’ part of Wizdom Configuration Center and click ‘Install’. This will make Wizdom try to reinstall the scriptloader on the current site collection and in some cases this can solve the issue.

If you have Wizdom installed on multiple site collections, and rather not want to install Wizdom on each and every site collection one by one, you can force an update of all site collections by adding a new dummy custom module in the ‘Custom Module’ part of Wizdom Configuration Center and then delete it again afterwards.

If Wizdom’s web parts are still not working after these actions, a reason can be that SharePoint has cached the expired client id/secret. This caching can last up till 12 hours and you will simply have to wait to find out whether this was the issue.

If Wizdom is not working after extension of Client

Secret

If Wizdom by any chance is having trouble with loading correctly after extending the Client Secret, please make sure to follow this guide to solve the problem.

1) Open the URL https://<customer-subscription>.sharepoint.com/sites/<wizdom-site> 

2) Click on  to open Wizdom Admin Center 

3) Go to Admin and click Sitecollections button  

4) Invoke re-install of Wizdom on the primary site collections 

Wizdom Digital Workplace

5) If there are more than one Wizdom site collection, and upgrade can be forced by creating a new dummy custom module in Wizdom 

6) Go to Admin and click Custom modules  

7) Select Add and fill in some dummy value

8) Click OK to save the new dummy custom module 

9) Invoke an Install/Upgrade on the remaining Wizdom site collections 

10) When completed, delete the dummy custom module again in Wizdom Admin Center 

If Wizdom after the above procedure is still not working, then the cause can be that SharePoint has cached ClientID/ClientSecret. This caching can last up to 12 hours before it is deleted and only step to take is to wait for the caching to expire.