Skip to main content

Single Sign-On for Flows

Cloud has the newest features. Some may not be in a release yet; the newest release is Identity & Access Management 7.3.0.

Single Sign-On (SSO) lets a user authenticate once and then reuse that authentication across applications, without repeating steps they have already completed. Choreo Identity & Access Management provides SSO as a building block inside authentication flows: you add two nodes to a flow, and the flow skips authentication steps whenever a valid session already covers them.

This guide explains how flow SSO works, describes the two SSO nodes, and shows how to add SSO to a flow. For the underlying session model, see Sessions and Single Sign-On.

How Single Sign-On Works​

Flow SSO is flow-centric: a session belongs to exactly one flow. Every application that authenticates through the same flow shares that flow's session, so the second application reuses the first application's authentication instead of prompting the user again. Two different flows never share a session.

A flow SSO session has three characteristics:

  • Per-flow. The flow is the grouping key. The session covers only applications that use the same flow.
  • Carried by the caller. A browser carries the session in a per-flow cookie. An application that runs the flow itself through the Flow Execution API carries it in the request body. See App-Native Sign-In.
  • Checkpoint-based. A checkpoint is the authentication that SSO can skip. You define it with a Check SSO Session node and a Save / Load Session node, and the checkpoint covers the steps between them. On a later sign-in, the flow reuses the checkpoint instead of prompting for those steps.

Single Sign-On Nodes​

You build flow SSO from two executor nodes in the Console Flow Builder. You place them around each authentication step you want to make skippable.

Check SSO Session​

The Check SSO Session node decides whether the following authentication step can be skipped. Place it immediately before the step. It answers the question: Can the following authentication be skipped by reusing the existing session? In a flow definition, it is a TASK_EXECUTION step that runs the SSOCheckExecutor.

The node has two outcomes:

OutcomeLink labelMeaning
SuccessSkip toA valid session already covers this step. The flow skips the step and continues from the target node.
FailureAuthenticateNo reusable session covers this step. The flow runs the full authentication step.

Save / Load Session​

The Save / Load Session node is the checkpoint. Place it at the point where the authentication you want to make skippable completes: the join point that both the Skip to and Authenticate paths lead to. In a flow definition, it is a TASK_EXECUTION step that runs the SessionExecutor.

The node performs one of two actions automatically, based on the request:

  • On a fresh sign-in, it establishes the session (or attaches to the session an earlier checkpoint in the same sign-in created) and saves the checkpoint for the authentication just completed.
  • On a reused session, it loads the saved checkpoint so downstream nodes read the authenticated user without re-running the steps it covers.

Add Single Sign-On to a Flow​

To make a group of authentication steps skippable, wrap them with a Check SSO Session node before the first step and a Save / Load Session node at the join point where they complete. The group can be a single step or multiple steps.

The following diagram shows a password step made skippable. The Skip to path bypasses the prompt and credential check; the Authenticate path runs them. Both paths converge on Save / Load Session.

To build this flow:

  1. Open the flow in the Console Flow Builder.
  2. Add a Check SSO Session node after the entry point, before the first authentication step you want to make skippable.
  3. Connect the Authenticate outcome to the first node of that authentication (for example, the credentials prompt).
  4. Add a Save / Load Session node after the authentication steps complete.
  5. Connect the Skip to outcome of Check SSO Session directly to the Save / Load Session node.
  6. Connect the final node of the authentication to the same Save / Load Session node, so both paths converge.
  7. Continue the flow from Save / Load Session to the remaining nodes (for example, authorization and the Auth Assertion Generator).

The first time a user signs in, the flow takes the Authenticate path and Save / Load Session establishes the session. On the next sign-in through the same flow, Check SSO Session finds the session and takes the Skip to path.

Organization Units and Single Sign-On​

A sign-in lands in one organization unit (OU) where both the user and the application are found. See Sign Users In to Organization Units. Single sign-on keeps to it:

  • A sign-in that has already decided its OU reuses a session only when the session's user can sign in to that OU. Otherwise the flow takes the Authenticate path, so another user of that OU can sign in, and a prompt=none request gets login_required.
  • A sign-in that reaches Check SSO Session with no OU decided follows the OU the user last signed in to with that session. If the user cannot sign in to the application from that OU, or the session has no such OU, the flow takes the Authenticate path. The user signs in again, and the flow decides the OU. A prompt=none request cannot ask the user, so it gets login_required instead.

Resolve OU cannot come after Save / Load Session. Saving a sign-in flow that can reach a Resolve OU node from a Save / Load Session node is refused with FLM-1044. Place the node in one of two places:

  • Sign in first. Place a Resolve OU node with the prompt strategy on the Authenticate path, between the sign-in step and Save / Load Session. A fresh sign-in decides the OU there, from the OUs the user can sign in to. A sign-in that reuses the session skips it and follows the last-used OU.
  • Pick first. Place a Resolve OU node with the prompt strategy before Check SSO Session. Both the fresh and the reused path pass through it, and a reused session is checked again against the OU the user chose.

Session Lifetime​

Two timeouts bound every flow SSO session:

  • Idle timeout: the maximum inactivity period. The idle deadline moves forward on each use of the session, so an active session stays alive. A sign-in that reuses the session counts as use, and so does a refresh_token grant for tokens issued under the session, so an application that keeps a user signed in by refreshing tokens keeps the session alive for other applications too. To limit database writes, the deadline moves at most once per activity-refresh interval, which is 1 minute by default. The default idle timeout is 2 hours.
  • Absolute timeout: the maximum total lifetime, fixed when the session is created and never extended. The default is 8 hours.

A session expires when it passes either deadline. After expiry, Check SSO Session takes the Authenticate path and the user signs in again.

On Choreo Identity & Access Management hosted tenants these timeouts are fixed at the defaults above. They are not configurable.

A token refresh keeps the session alive only if it arrives before the idle deadline; a later refresh does not revive an expired session. An application that refreshes when its access token expires therefore needs an idle timeout longer than the access token validity period. The default idle timeout of 2 hours leaves room for the default access token validity of 1 hour. A deployment that follows NIST SP 800-63B-4 at AAL2, which recommends an inactivity timeout of no more than 1 hour, should set the idle timeout to 3600 seconds or less and set the access token validity period of its applications below it.

Choreo Identity & Access Management references each flow SSO session with a per-flow cookie named tid_sso_<hash>, where <hash> is derived from the flow identifier. A separate cookie per flow keeps one flow's session from affecting another. The cookie carries only an opaque handle, never user data, and its attributes follow browser security best practices:

  • HttpOnly, so client-side scripts cannot read it.
  • SameSite=Lax.
  • Secure, when the server runs over TLS or server.public_url uses https, as behind a proxy that terminates TLS.

The cookie lifetime matches the absolute session timeout.

App-Native Sign-In​

An application that runs flows itself through POST /flow/execute has no browser cookie, so Choreo Identity & Access Management also returns the session in the response body. The application stores it and sends it back on later requests.

When a step starts a session, the response includes it in the sessionData array, in the same shape the request uses plus expiresIn. The per-flow cookie is set as well. The session starts at the Save / Load Session node, which need not be the last step, so sessionData can arrive on an INCOMPLETE response. Store it from any response that includes it.

{
"executionId": "01a17bb9-4fd5-7979-afda-9760afc83397",
"flowStatus": "COMPLETE",
"data": {},
"assertion": "<jwt_token>",
"sessionData": [
{
"flowIdentifier": "f51bdb0f22d906bb",
"sessionHandle": "<session_handle>",
"expiresIn": 28800
}
]
}
FieldDescription
flowIdentifierIdentifies the flow the session belongs to. It is the <hash> part of the tid_sso_<hash> cookie name.
sessionHandleThe session handle. It is the cookie's value.
expiresInSeconds until the session reaches its absolute timeout. It matches the cookie lifetime.

To reuse a session, send every session the application holds in the sessionData array of each request of the flow, not only the first. Choreo Identity & Access Management does not keep the handle with the flow, so a Check SSO Session node reached after a prompt step uses the session sent with that request. Choreo Identity & Access Management uses the entry whose flowIdentifier matches the flow being run, ahead of any session cookie. When that session is valid, Check SSO Session takes the Skip to path. An entry without a flowIdentifier or a sessionHandle is refused with a 400 error.

{
"applicationId": "01a17b81-f398-754c-9bc6-2eb2802e1e02",
"flowType": "AUTHENTICATION",
"sessionData": [
{
"flowIdentifier": "f51bdb0f22d906bb",
"sessionHandle": "<session_handle>"
}
]
}

A step that reuses a session does not return sessionData again. To sign the user out, send the same sessionData with a SIGNOUT flow. A sign-out acts on the application's sign-in flow, so Choreo Identity & Access Management uses the entry whose flowIdentifier matches that flow and ends only that session. The response lists the session in clearedSessions, by flowIdentifier, so the application can delete it. The listing does not confirm the session was still active.

The session handle resumes the session without authentication, so store it as you would a credential. The cookie's HttpOnly attribute does not protect a handle in a response body: any code that reads the response can read it. A handle is not bound to the application that received it, so any application whose sign-in flow is the session's flow can present it.

Was this page helpful?