Creating an SSO Session
The Kigo API enables partners to create SSO sessions for their users. These sessions facilitate seamless redirection to TOP site or embedding TOP within an application via iframes.
Prerequisites
Before making an API call to create an SSO session token on behalf of a user, obtain a partner-level session token by following the API Authentication Guide.
Steps to Implement
-
Creating an SSO Session
- Endpoint: Create an SSO session for a user.
- Purpose: This endpoint generates a session for the program associated with the
external_program_id
and the account linked to theexternal_user_id
. - Session Expiration: The
session_id
is valid for 30 minutes. After expiration, a new session must be created to load a valid iframe from a Kigo-hosted site or to redirect to a Kigo-hosted site. - Usage: Include the returned
session_id
in the URL parameters when embedding or redirecting to TOP site.
-
Using the SSO Session ID
- URL Example:
https://kigo-top-test.kigodigital.net/sso/[external_program_id]?uuid=${session_id}
- URL Example:
Key Considerations
- Program-Specific Configuration
- A partner informs their primary contacts at Kigo of a new program they want to launch with a custom configuration. After providing the
external_program_id
and the desired customization, a Kigo administrator configures the program within Kigo's systems.
- A partner informs their primary contacts at Kigo of a new program they want to launch with a custom configuration. After providing the
- Handling Unknown
external_program_id
andexternal_user_id
: If Kigo encounters unknown identifiers, it creates new entities within its system. If no program exists for the partner whose session token was used, Kigo will create a new program associated with the providedexternal_program_id
. Similarly, a new account is created for an unknownexternal_user_id
. - Session Storage: Kigo recommends enabling
is_single_use
for all sessions to reduce the risk of session reuse, especially in cases where the session ID or token is stored in local storage or is accessible on the client side. Setis_single_use
tofalse
only if persistent client-side storage (e.g. local storage or cookies) is impossible and the session must be reused in a trusted environment.
Example Workflow
- End-user clicks a button inside a partner's web application.
- The application sends an API call to the partner's server.
- Obtain a partner-level session token using the provided endpoint in the server.
- Create an SSO session by making an API call to receive a
session_id
, which authenticates the user into a Kigo-powered experience. - Pass the
session_id
back to the web application. - Redirect the user to TOP at:
https://kigo-top-test.kigodigital.net/sso/[external_program_id]?uuid=${session_id}
Best Practices
- Secure Handling: The
session_id
can safely be passed to the client due to its limited, time-bound access. However, partner-level credentials should remain on the back-end server, never exposed to the front-end client.
Updated 4 days ago