# PingOne

## Introduction

With a `PingOne` SSO implementation, users log into the Patchworks dashboard from PingOne. Your PingOne administrator determines who has access to Patchworks and these users will see a Patchworks app in their PingOne dashboard.

Selecting this app directs the authenticated user to the Patchworks dashboard, where they are logged in directly. PingOne users never see or require a password to access the Patchworks dashboard.&#x20;

{% hint style="info" %}
Your PingOne administrator requires a Patchworks account with administrator permissions to complete this setup.
{% endhint %}

This guide details the setup required to integrate Patchworks with PingOne. For clarity, the setup is documented in six stages:

* [Stage 1: PingOne - create app for Patchworks](#stage-1-pingone-create-app-for-patchworks)
* [Stage 2: Patchworks - add PingOne provider & generate URLs](#stage-2-patchworks-add-pingone-provider-and-generate-urls)
* [Stage 3: PingOne - configure app](#stage-3-pingone-configure-app)
* [Stage 4: Patchworks - apply PingOne credentials & enable](#stage-4-patchworks-apply-pingone-credentials-and-enable)
* [Stage 5: PingOne - define scopes](#stage-5-pingone-define-scopes)
* [Stage 6: Test the connection](#stage-6-test-the-connection)

## Demo

The steps detailed in this guide are shown in this demonstration video:

<figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FSuOvJ6Ca2IvjFuOlV645%2FPingOne%20setup%20demo.gif?alt=media&#x26;token=3b494030-61d0-4351-8009-005140787275" alt=""><figcaption></figcaption></figure>

## Prerequisites

* Your Patchworks user account must be associated with [administrator permissions](https://doc.wearepatchworks.com/product-documentation/users-roles-and-permissions/roles-and-permissions-summary).
* You must have administrator access to your PingOne dashboard.

## Stage 1: PingOne - create app for Patchworks

In this stage, we create a new app in PingOne and copy the associated `issuer id` for use in the next stage.

**Step 1**\
Log into PingOne and select `administrators` | `applications` | `applications` from the navigation menu:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FuZ2Gj18SubhNWWfV4pwh%2Fpingone%201.png?alt=media&#x26;token=29a1da92-691a-4ca3-b7c0-d46765f0eea7" alt=""><figcaption></figcaption></figure></div>

**Step 2**\
Click the plus icon at the top of the page:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FAwOxGUY30IScmNhzDpxm%2Fpingone%202.png?alt=media&#x26;token=baf253e2-c230-456a-b4a9-5918210f79ec" alt=""><figcaption></figcaption></figure></div>

**Step 3**\
Enter an `application name` (we suggest `Patchworks` or similar), then select `OIDC Web App` as the application type, and save changes:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2Fd6fXprtdvlyrXHveXJ0A%2Fpingone%203a.png?alt=media&#x26;token=5e27d08b-9284-4d37-8b7b-efcc37b70db2" alt=""><figcaption></figcaption></figure></div>

The app is saved/published and configuration details are shown.

**Step 4**\
Scroll down to the `connection details` section and copy the `issuer ID`:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2Fg4bnZ6o5RTYkbo7BEgF9%2Fpingone%204.png?alt=media&#x26;token=23b04265-3caf-4ed5-a773-3b8ec58fc4cc" alt=""><figcaption></figcaption></figure></div>

**Step 5**\
Leave this page where it is and go to the next stage.

## Stage 2: Patchworks - add PingOne provider & generate URLs

In this stage, we add a new SSO provider in Patchworks using your PingOne `issuer ID` (obtained in the previous stage) as the `base URL`. This generates a set of URLs that we'll go on to apply in PingOne.&#x20;

**Step 1**\
In a new browser tab or window, log into the [Patchworks dashboard](https://app.wearepatchworks.com/) and select `my company admin` from general settings:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FVug9swL4CvhMUF8Z7q86%2Fsso%201.png?alt=media&#x26;token=62dce850-0191-4356-aa77-a24bbf8602e7" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
If you don't see this option, it's most likely that your user account is not associated with administrator permissions. In this case, please contact your system administrator.&#x20;
{% endhint %}

**Step 2**\
Click the `PingOne` button:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FscoIpF3BAfirbmMpW3nb%2Fpingone%205.png?alt=media&#x26;token=661740c3-3b67-42b3-8036-17069db98f6d" alt=""><figcaption></figcaption></figure></div>

**Step 3**\
Paste the `issuer ID` for your new PingOne app (copied at the end of the [previous stage](#stage-2-patchworks-add-pingone-provider-and-generate-urls)) into the `base URL` field **but remove the `/as` characters from the end**:&#x20;

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2F1uJ4e3qCCbmykEfm6QzH%2Fpingone%203a%202.png?alt=media&#x26;token=29f836c9-f2a8-4ef0-a81b-6f691bd700ec" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="warning" %}
It's important to remove the `/as` characters from the end of the `issuer ID`. For example: \
`https://auth.pingone.eu/3c2eca2e-fc6e-4509-8154-68d93a9dbdf3/as` would be entered as:\
`https://auth.pingone.eu/3c2eca2e-fc6e-4509-8154-68d93a9dbdf3`.
{% endhint %}

**Step 4**\
Click the `create` button to confirm.

**Step 5**\
A PingOne provider is added - click this entry:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FpInchKLtnoupC7kHhZ5i%2Fpingone%207a.png?alt=media&#x26;token=a60d5b26-632a-4bec-9461-7bab3f7c1346" alt=""><figcaption></figcaption></figure></div>

...you'll see that three Patchworks URLs have been generated - for example:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2F3S95PQFo8xz2PgccOvR3%2Fokta%20a6.png?alt=media&#x26;token=399ef54f-400e-4ee1-b569-898565c08f70" alt=""><figcaption></figcaption></figure></div>

These URLs are needed to complete your PingOne setup in the next stage. For reference, these are:

| Patchworks URL          | PingOne usage            |
| ----------------------- | ------------------------ |
| Initiate sign-in url    | `Initiate Login URI`     |
| Callback url (auth url) | `Redirect URIs`          |
| Logout url              | Not required for PingOne |

{% hint style="info" %}
Note that URLs shown in our screenshots are for a development environment -`dev.app.wearepatchworks.com`. Yours will always be for a production environment -`app.wearepatchworks.com`.
{% endhint %}

**Step 6**\
Optionally, you can click the `edit` option here and set a specific name for this implementation:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FRSOtpT0dNO1cL0O1ZPWD%2Fpingone%20name.png?alt=media&#x26;token=98f8cf23-168d-4d78-b318-ae0dc83240a0" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
This isn't mandatory but using specific names can be useful if you're adding multiple implementations of the same type. Remember to save your change if you do update the name.&#x20;
{% endhint %}

**Step 7**\
Save changes.

**Step 8**\
Leave this page open and switch back to PingOne for the next stage.

## Stage 3: PingOne - configure app

In this stage, we configure your new Patchworks app in PingOne. As part of this setup, we will provide URLs generated by Patchworks, at the end of the previous stage.

**Step 1**\
Back in PingOne, select the `configuration` tab:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FZBILbPlWgdqsnqhukH5I%2Fpingone%208.png?alt=media&#x26;token=40782d50-4bc9-4e25-91ad-8e219ed04fda" alt=""><figcaption></figcaption></figure></div>

**Step 2**\
Edit settings, then move down to the `redirect URIs` field and paste the `callback URL` value from your PingOne provider setup in Patchworks:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2Fy0ie0S0muvwH4PZ9VGU9%2Fpingone%2010b.png?alt=media&#x26;token=3da58510-9725-4b3d-a266-e04275bfdfe0" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
When copying URLs from your Patchworks provider details, click anywhere on the required link to copy it to your clipboard:

<img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FTgloqNmUUKZfcK1hDUqA%2Fpingone%20callback%20select.png?alt=media&#x26;token=9b19a579-5c11-43d4-8880-47f9fb50d77e" alt="" data-size="original">
{% endhint %}

**Step 3**\
Set `token endpoint authentication method` to `client secret post`:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FGx1ZHj17OGaY8ZauvIn4%2Fpingone%209a.png?alt=media&#x26;token=a81a6bed-19b0-4da9-93e4-144f563c20bb" alt="" width="563"><figcaption></figcaption></figure></div>

**Step 4**\
Move down to the `initiate login URI` field paste the `initiate sign-in URL` value from your PingOne provider setup in Patchworks:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FJVIxUuyPaPYptdx1fhh1%2Fpingone%2010.png?alt=media&#x26;token=9f7b2a9f-7668-4eb8-a8c9-5efffb37cce2" alt="" width="563"><figcaption></figcaption></figure></div>

**Step 5**\
Save your changes and go to the next stage.

## Stage 4: Patchworks - apply PingOne credentials & enable

In this stage, we take client credentials generated in PingOne, apply them to our PingOne provider setup in Patchworks, and enable this SSO implementation.

**Step 1**\
Still in PingOne, scroll to the top of the configuration page and toggle the 'enable' option (to the right of the app name) to the `on` position:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2F5aVAl72rhon8g2LIeXgn%2Fpingone%2012c.png?alt=media&#x26;token=2c7b1119-2afd-4a05-88a1-a05bf07ce509" alt=""><figcaption></figcaption></figure></div>

**Step 2**\
A little further down, you'll see `client id` and `client secret` details - copy the `client id`:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FxhTHlmQqbP2gJHdL0xa6%2Fpingone%2011.png?alt=media&#x26;token=88f06f16-b718-4820-8f3b-cdc7c5a9e2f7" alt=""><figcaption></figcaption></figure></div>

**Step 3**\
Switch to Patchworks and select the `edit` option for your PingOne provider setup:

<figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FcKrywvEfeH2897etv2I8%2Fpingone%2012.png?alt=media&#x26;token=285b303a-23e6-4ce5-965e-df844fc2489e" alt=""><figcaption></figcaption></figure>

**Step 4**\
Paste the  `client id` and then repeat the copy/paste for the `client secret` value:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FChixN0RPNbt4P34R3Q3h%2Fokta%20e4a%201.png?alt=media&#x26;token=c6be6025-de56-4f92-8a27-770cf17494f2" alt=""><figcaption></figcaption></figure></div>

**Step 5**\
Toggle the `enable` option to `on`:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2Fkp9tIvsBZ6B0GbdGmCXL%2Fpingone%2012b.png?alt=media&#x26;token=62568042-e824-4786-ae15-174f19b1ee6b" alt=""><figcaption></figcaption></figure></div>

{% hint style="warning" %}
The SSO implementation won't be operational until this setup is enabled.&#x20;
{% endhint %}

**Step 6**\
Save changes:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2F8tHpjdPfwQVDIGl4NN3W%2Fpingone%2012d.png?alt=media&#x26;token=e0dde895-a68d-4fd9-86f9-c8599ffc78fe" alt=""><figcaption></figcaption></figure></div>

## Stage 5: PingOne - define scopes&#x20;

In this stage, we define permissions (scopes) for the connection between PingOne and Patchworks.&#x20;

**Step 1**\
Still in PingOne, select the `resources` tab at the top of the page:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2F3i32bDVTtp3bgehQJoyI%2Fpingone%2013a.png?alt=media&#x26;token=52a19bb8-3cb7-4aa4-bdf0-e94448d9947d" alt=""><figcaption></figcaption></figure></div>

**Step 2**\
Edit scopes and make the following selections:

* `email`
* `offline access`
* `profile`

For example:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FnENZEkpLJIyVP8DCBkBW%2Fpingone%2013b.png?alt=media&#x26;token=89c28191-9f62-49ef-84ac-33eb54f15cad" alt="" width="563"><figcaption></figcaption></figure></div>

**Step 3**\
Save changes to complete the setup. When you're ready you can go on to assign groups/users who can access Patchworks. This is standard PingOne functionality that isn't covered here.

## Stage 6: Test the connection&#x20;

To quickly test that a successful connection has been made between Patchworks and PingOne, switch back to the Patchworks dashboard, and copy the `initiate sign-in URL` value:

<figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FzXd24PVQeftCJFhGJghE%2Fpingone%2014a.png?alt=media&#x26;token=8616063c-a682-40fc-b072-e503d33728f8" alt=""><figcaption></figcaption></figure>

Now log out of Patchworks and paste the `initiate sign-in URL` value into your browser - this should log straight into the Patchworks dashboard.
