Code On Time web applications feature the ability to operate in Software-as-a-Service mode. It is possible to give access to your line-of-business web app from SharePoint Online using this mode. By default, a client will be authenticated by SharePoint, and logged into the user account with matching email. If the user account with that email is not found, then that account will be created. Every sign in will synchronize the SharePoint user’s assigned groups with the web application user’s roles, creating roles as necessary.
Please note that it is highly recommended to deploy your app with SSL – otherwise, browsers must be placed in “low-security” mode in order for the web part to work.
Adding the Web Part
The first step to configuring the Cloud On Time for SharePoint add-in is to install the app to your SharePoint site.
Once the add-in has been installed, the “Cloud On Time” web part can be added to any page of your site. The following instructions explain how you can create a new page and connect an existing Code On Time or Cloud On Time application to your SharePoint instance.
Navigate to the home page of the SharePoint site, click the “PAGE” tab of the ribbon at the top of the screen, and select “View All Pages”.
Next, select “New” on the toolbar, and choose “Web Part Page”.
Give the page a name, and select “Full Page, Vertical” for the template in order to maximize the real estate for the web part. Set the Document Library property to “Site Pages”.
After pressing “Create”, you will navigate to the new page. Select “Add a Web Part” in the center of the screen. Pick “Cloud On Time Page” from the list of parts, and press “Add”.
The web part will be dropped onto the page. In the top-right corner of the web part, press the down chevron and select “Edit Web Part”.
The web part properties window will be opened. Under “Appearance” section, change Chrome State to “None”. Expand the “Software as a Service” section, and specify the URL of your cloud app in the Cloud property. Optionally specify a Start Page or disable the navigation.
Press OK to save changes.
Registering The App
The next step is to register the app in order to enable your web application to authenticate users and query user groups. Click on the “register” link displayed in the default web part contents, or navigate to “https://mysite.sharepoint.com/_layouts/15/AppRegNew.aspx”, making sure to replace the root with your SharePoint site URL.
Press “Generate” next to Client Id and Client Secret fields to generate new values. Enter a title for the app, and specify the app domain. The Redirect URI must be equal to the app domain with the path “appservices/saas/sharepoint” appended to the end.
Press “Create” to create the app registration. Make sure to copy the registration details from this screen, as shown below.
Next, navigate to your Cloud On Time or Code On Time application, sign in as a user with administrative role, and navigate to your Site Content page. Create a new record with the following properties. The Text property can be composed from the text copied from SharePoint, with the Client Uri added on the next line.
|Property ||Value |
|Name ||sharepoint |
|Path ||sys/saas |
|Text || |
Press OK to save the service registration.
Using the Web Part
Switch back to the SharePoint page, and refresh the browser. If the registration has been configured correctly, the Cloud On Time or Code On Time application will load in the web part zone. This application will “talk” directly to your SharePoint instance via OAuth protocol to obtain the user name, email, and groups. The result of this conversation is a prompt displayed to the end user asking to trust the application.
If the user presses “Trust It”, then the application will sign the user in with the user’s SharePoint identity, and assign the groups as roles to that user. The user will then be redirected to the start page specified in the web part properties.