- Generate an SSO embed user and session via
POSTrequest, returning a session token to be redeemed at a later time - Redeem the generated session token and redirect to the specified content via a login URL
Requirements
To follow the steps in this guide, you’ll need:- Organization Admin permissions
- To have the Embed feature enabled in your Omni instance
Setup
1
Generate an embed secret
The first step is to generate an embed secret:
- Navigate to Settings > Embed > Admin in your Omni instance:
- Click the Reset Secret button to generate your random secret key.

2
Optional: Customize session length
In the Embed settings of your Omni instance, you can also customize the length of embed sessions using the Session Length setting. In this field, enter the number of hours you want sessions to be and click Change.
3
Generate an Omni API key
Note: As with all other API endpoints, an
Authorization header with an Omni API key as a Bearer token is necessary for authentication purposes. Refer to the API docs for more information.4
Generate the user & session
In this step, you’ll generate the embed user and session. This is done by sending a Once a successful request is made, a few things will happen:
POST request to the /api/unstable/embed/sso/generate-session endpoint. This will return a token that will be redeemed later.Most parameters listed in the Embed parameters reference can be passed in the JSON body of the request. The only exceptions are:themeandprefersDark, which can be set via URL parameters in the login URL, andnonce, which isn’t necessary at this step
contentPath, externalId, and name are required.POST /api/unstable/embed/sso/generate-session
- The endpoint will return a JSON payload with a single
sessionIdproperty. ThissessionIdwill be used in the next step during session redemption. - An embed user will be upserted into your organization based on the request body’s values.
- An embed session will be created for this embed user with a 5 minute expiry. For security purposes, if the session isn’t redeemed within 5 minutes of creation, the session will no longer be usable.
5
Generate the session redemption signature
If using the TypeScript SDK
redeemSessionToken function, the signature will be automatically generated and included in the returned session redemption URL.-
Concatenate the required properties, delimited by a newline character in the exact order enumerated below. Note: The parameters are in alphabetical order, with the exception of the leading login URL:
-
Concatenate the optional properties in alphabetical order, delimited by a newline character. Omit any undefined properties.
Do not include leading or trailing spaces. Include only a single newline between each part of the signature. The following example includes optional parameters for custom theme, entity, filter search param, prefers dark, link access, theme, and user attributes:
-
Sign the string using the Embed secret you created in step 1 with an HMAC sha256 digest algorithm, encoded as a base64url string. Refer to this standard for more information about base64url.
Node.js example
6
Redeem the session
With the Once the URL is passed into an
sessionId, you can now create a 2-step session redemption URL. Like standard SSO embed login URLs, session redemption URLs should be passed into the src attribute of an iframe HTML element.In addition, 2-step SSO embed login URLs must be signed using the request host, a nonce, and other URL parameters. You’ll use the signature you generated in the previous step to sign the embed login URL.-
Required URL parameters:
- Session ID (
sessionId) - Nonce (
nonce) - Signature (
signature)
- Session ID (
-
Optional URL parameters:
- Prefers dark (
prefersDark) - Theme (
theme)
- Prefers dark (
Example URL
iframe and a successful session redemption request is made, the following will happen:- The associated embed session will update its expiry from 5 minutes to 24 hours, or to the custom Session Length specified in the Admin > Embed section of your Omni organization.
- The iframe will redirect to the
contentPathspecified during session generation.