New Ory Agent Security is now live! Claim your complimentary test drive. Get Started!

Skip to main content

Setup links for directory sync

The Setup link is used to create a shareable link that can be used to create a Directory Sync connection without access to the Admin Portal. The link gives its holder the directory's SCIM endpoint and token, which their Identity Provider needs to sync users and groups, so share it only with the person who configures that Identity Provider. Let's go through the steps to create a new Setup link.

You can create a new setup link for Directory Sync from the Connections page using New Setup Link button

dsync connections page

Another way is to go to the Setup Links section under Directory Sync menu and Click on Create New/New Setup Link button

dsync setup link list empty

The create Setup Link for Directory Sync page looks like below

dsync setup link create page

Once the link is created you can see the the link info section at the bottom

setup link created

You can copy the link by clicking on the Copy button

setup link copied

You can regenerate the link by clicking on Regenerate button

setup link regenerate init

Once you confirm Regenerate action you will see the new setup link in the link info section

setup link regenerated

Regenerating issues a new URL and invalidates the previous one straight away. Share the new link with whoever is setting up the connection: a URL copied from the link info section earlier no longer opens the setup page.

Setup links expire, three days after creation by default. Creating a setup link for a tenant and product whose link has already expired renews it, and renewal behaves like regenerating — you get a new URL, and the expired one stays invalid.

The same applies to the /api/v1/dsync/setuplinks endpoint: it returns the current link unchanged while that link is still valid, and issues a new URL when you pass regenerate: true or when the existing link has expired.

Requests to POST /api/v1/dsync/setuplinks for the same tenant and product that arrive at the same time, whether they create, renew or regenerate the link, issue one link, and every request receives that link. A request that cannot read the link another request is issuing yet is rejected with a 409; retry it to receive the link.

To read or delete a link through /api/v1/dsync/setuplinks, pass its id, or the tenant and product it was created for. A request with neither is rejected with a 400, and so is a GET /api/v1/dsync/setuplinks/product request without a product.

You can perform ACTIONS like Copy, View, Regenerate & Delete from this page

setup link list page

When you open the setup link you will see the following

setup link page dsync

Create Directory Sync connection​

You can open create Directory Sync by clicking on New Directory button & filling the correct details

dsync setup link created

After creation of the directory sync you will see the info section

dsync created info

The person holding the link chooses only the directory type. The name, tenant, product and webhook come from the setup link. They see the directory's name, type and status, the SCIM endpoint and token to configure their Identity Provider with, and whether Google Workspace authorization is complete. They do not see the webhook. They can turn the directory on or off and delete it, and change nothing else.

A setup link reaches only the directories of its own tenant and product. Opening a directory of another tenant or product fails with a 400 and Tenant/Product mismatch. An Enterprise SSO setup link cannot be used on these pages, and fails with a 403. An expired link fails with a 401, and an unknown one with a 404.

The setup link pages call these routes. The token in the path authorizes the request, and every route answers an error as { "error": { "message": "..." } }.

RouteResponse
GET /api/setup/{token}200 with the link's details in data, without its tenant, product and webhook
GET /api/setup/{token}/directory-sync200 with the link's directories in data: id, type, name and deactivated
POST /api/setup/{token}/directory-sync201 with the new directory, in the same form, in data. The body sets only type
GET /api/setup/{token}/directory-sync/{directoryId}200 with the directory in data, adding scim, google_authorized and google_authorization_url
PATCH /api/setup/{token}/directory-sync/{directoryId}200 with the directory's id, type, name and deactivated in data. The body sets only deactivated
DELETE /api/setup/{token}/directory-sync/{directoryId}200 with data set to null
GET /api/setup/{token}/directory-sync/providers200 with the supported directory providers in data