Login Sharing Restriction
Node Topology
How It Works
Two nodes work together to enforce session limits:
| Node | Role |
|---|---|
| Data Query | Evaluates the number of active sessions the user currently has using the virtual field Sessions.Count |
| Force Logout | Invalidates all active sessions for the user except the current one, keeping the user logged in on the device where the action was triggered |
Sessions.Count is computed live when the Data Query node executes. It counts sessions across all linked profiles for the user. If the lookup fails for any reason, the field is treated as absent and the rule evaluates to false: the user is not blocked.
Workflow Patterns
Pattern 1: Show a Warning Screen (Recommended)
Show the user a screen explaining that their other sessions will be ended. The user confirms, and the workflow revokes the older sessions and proceeds.
Use this when: You want to inform the user that their other sessions will be ended and give them a chance to acknowledge before proceeding.
Pattern 2: Silent Revocation
Older sessions are revoked automatically when the limit is reached, with no interruption to the user experience.
Use this when: You want to enforce the limit with no user-visible interruption.
Pattern 3: Require Re-verification Before Revoking
Require the user to verify their identity via OTP before older sessions are revoked.
Use this when: You want an extra security step before revoking sessions: for example, confirming the user is aware of and authorizing the revocation.
Setting Up Login Sharing Restriction
Prerequisites
- An active Identity Orchestration workflow with at least one authentication node (Auth or Social Auth).
Step 1: Add a Data Query Node
- Open your workflow in the Admin Console under Platform Config → Authentication → Workflows.
- After your authentication node, add a Data Query node.
- Open the Data Query node's property panel and add a rule:
- Field:
Sessions.Count - Operator:
>= - Value: your session limit (e.g.
3)
- Field:
- Save the node.
Step 2: Wire the True Output
Connect the true output to whichever pattern you want to use when the limit is exceeded:
| Pattern | True output wires to |
|---|---|
| Pattern 1 (warning screen) | Session Limit Web Page → Force Logout |
| Pattern 2 (silent) | Force Logout directly |
| Pattern 3 (re-verify) | OTP Verification node → Force Logout |
Step 3: Wire the False Output
Connect the false output directly to the Success Final node.
Step 4: Wire Force Logout to Success
Connect the Force Logout node's output to the Success Final node.
Step 5: Test the Flow
- Log in with the same account on more than N devices or browsers.
- On the next login attempt after the limit is reached, verify that the flow takes the
truepath. - Confirm that older sessions are invalidated and the new session remains active.
Changing the Session Limit
Open the Data Query node in the workflow editor and update the threshold value (e.g. change >= 3 to >= 5). The change takes effect immediately for new login attempts: no redeployment required.
Important Considerations
| Topic | Detail |
|---|---|
| Current session is always kept | Force Logout never revokes the session that triggered it. The user always completes login on their current device. |
| Linked accounts | Sessions across all linked profiles are counted and revoked, not just the primary profile. |
| Session count timing | Sessions.Count is evaluated before the new session's access token is issued, so the count reflects only pre-existing sessions. |
| Failure safety | If the session count lookup fails, Sessions.Count is absent and the rule evaluates to false: the user is not blocked. |
| Token types counted | Only access tokens (full login sessions) are counted. Interim feature tokens (forgot password, PIN session, etc.) are excluded. |
| Limit is per-workflow | Each workflow has its own session limit configured independently in its Data Query node. |
The Force Logout node invalidates all sessions except the current one. If you have multiple workflows sharing the same user base, revoking sessions in one workflow affects sessions created by all workflows for that user.