Connecting your application to SharePoint
Ensure that your SharePoint Online integration component works correctly by configuring your SharePoint environment and Pega Platform rules that ensure successful SharePoint authentication and run-time processing of the component data pages.
Performing preparatory tasks for integrating SharePoint
Prepare your SharePoint environment for integration with Pega Platform by creating an add-in app for a SharePoint site.
After you add this app, a Pega application can perform actions on SharePoint entities, such as lists, list items, fields, files, or folders.Before you begin: Ensure that you have a SharePoint site to which you have
administrative access.
- Create and register an app for your SharePoint site.For instructions about app registration, see the Microsoft SharePoint documentation: Register SharePoint Add-ins.
Remember: Set the Redirect URI to match your Pega app. Do not change the Redirect URI afterward. - Note and copy the client ID and client secret for your SharePoint app.
Note: You need the client ID and client secret to correctly configure the rules from the Pega SharePoint Online integration component. - Retrieve the app registration information, and then modify the app permissions
to allow creating and modifying lists.For more information on retrieving the app details and modifying the permissions, see the Microsoft SharePoint documentation:
For example: The following code snippet illustrates a sample Permission Request XML that accordingly modifies the app permissions: <AppPrincipal> <RemoteWebApplication ClientId="clientID" /> </AppPrincipal> <AppPermissionRequests> <AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="Write"/> <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="Write"/> <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web/list" Right="Write"/> <AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="Write"/> </AppPermissionRequests>
- Submit your changes and confirm the new app permissions.
Configuring the SharePoint Online component
Make your Pega application ready for integration with SharePoint Online by configuring a set of rules from the SharePoint Online component.
- In Dev Studio, find and open the
SPOnlineSettings data transform.
Note: Pega Platform uses the configuration details from this data transform for run-time processing of data pages that correspond to various SharePoint APIs. - Click Save as, and then click Create and open.
- On the Definition tab, in the
Source column for the .SiteURL
property row, replace <<SPO_SiteUrl>> with
your own SharePoint root URL.
For example: "https://uplus.sharepoint.com" - In the Source column for the
.GlobalSiteName property row, enter the site to which
the SharePoint add-in app has access.
For example: "sites/UPlus-Health" - If your configuration uses an authentication profile that is different from the default one, in the Source column for the .AuthenticationProfile property row, replace SPOnlineAPICredentials with the value that matches the other authentication profile.
- Find and open the D_SPOnlineGetRealm data page.
- Click ActionsRun.
- In the displayed window, select the Flush all instances of this data page before execution checkbox, and then click Run.
- Copy the values for the Realm and
AudiencePrinciaplID properties.You need these values to configure the access token endpointin the authentication profile.
- Find and open the SPOnlineAPICredentials authentication profile.
- In the Client configuration section, populate the Client identifier and Client secret fields with the client ID and client secret from your SharePoint add-in app.
- In the Endpoint configuration section, replace the
following placeholder strings with appropriate data:
- <<SPO_Site_Domain>> – your SharePoint site domain
- <<REALM>> – the Realm value from the D_SPOnlineGetRealm data page
- <<Host_Name>> – your system-specific host for the redirect
- Next to the Access token endpoint field, click Edit access and refresh token parameters.
- In the Endpoint parameters window, in the Add
access token parameters section, replace the following strings
with appropriate data:
- <<CLIENT_ID>> – the client ID from your SharePoint add-in app
- <<REALM>> – the Realm value from the D_SPOnlineGetRealm data page
- <<AudiencePrincipalID>> – the AudiencePrincipalID value from the D_SPOnlineGetRealm data page
- <<SPO_Site_Domain>> – your SharePoint site domain
- Confirm changes to the endpoint parameters by clicking
OK.The following figure illustrates all placeholders that you must replace with appropriate data:
- Confirm changes to the authentication profile rule by clicking Save.
Configuring the SharePoint URL and site details
Acquiring the SharePoint authentication details
Configuring the authentication profile
What to do next: Add data types from the component to your application
definition to use them in the context of your application. For more information, see
Using the SharePoint Online component.
Previous topic Installing the SharePoint Online component Next topic Using the SharePoint Online component