Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

PingFederate Integration Guide

Prerequisites

  • PingFederate admin console access

  • Twosense Endpoint Agent v3.12.0 or later

  • Imprivata Agent (if using badge tap as a step-up)

Understanding the Twosense IdP Flows

To support multiple different workstation types, our identity provider comes with two different flows:

  • Identity Flow: When the user's identity is not known, you can use this flow to obtain it from the workstation and provide it to subsequent steps in your policy. It does not authenticate the user.

  • Auth Flow: Once the user's identity is known (e.g., through Kerberos or an earlier Identity Flow step), you can use this flow to authenticate the user with Twosense or a configured step-up remediation, such as an Imprivata badge tap.

Which ones you use depend on your specific setup. If you're unsure, feel free to contact us and we will be happy to help with the integration process.

Enabling the Identity Provider

To enable Twosense identity provider access for your tenant, please contact us. Self-serve activation is not currently available.

Allow Local Network Access

The Twosense IdP uses local requests to communicate with the Twosense Endpoint Agent, and starting with Chrome version 142 this is automatically blocked unless explicitly allowed by the user or via Group Policy. In order to allow this behavior, you will need to add a policy exception.

Use the LocalNetworkAccessAllowedForUrls policy to grant the Twosense IdP local network access. Add the following to the list of allowed URLs:

Identity Flow Setup

The identity flow tells PingFederate which user is signed in to a shared workstation. It doesn't check whether the person should get access; that's the auth flow's job. You'll create one OpenID Connect IdP connection for it, using the identity client credentials from your Twosense representative.

Before you start, have these values from your Twosense representative ready:

  • The identity flow's Issuer (for example, https://idp.twosense.ai/acme-1234/identity)

  • The identity client's Client ID and Client Secret

Create the Identity Connection

  1. Navigate to AUTHENTICATION and select IdP Connections.

  2. Click Create Connection.

  3. In the Connection Type tab, check Browser SSO Profiles, set Protocol to OpenID Connect, and click Next.

  4. In the Connection Options tab, leave Browser SSO checked and click Next.

  5. In the General Info tab, set the following:

    • Issuer: {Identity flow issuer}

    • Click Load Metadata. This fills in the endpoints you'll see later in Protocol Settings.

    • Connection Name: Twosense Identity (or another descriptive name)

    • Client ID: {Identity client ID}

    • Client Secret: {Identity client secret}

    • Click Next.

  6. In the Browser SSO tab, click Configure Browser SSO.

  7. In the User-Session Creation tab, click Configure User-Session Creation.

    1. In the Identity Mapping tab, select No Mapping and click Next. This connection is only used inside an authentication policy, so it doesn't create a session of its own.

    2. In the Attribute Contract tab, add each of the following under Extend the Contract, clicking Add after each one, then click Next:

      • acr

      • amr

      • twosense_flow

      • upn

      • device_hostname

      • imprivata_assertion_id

      See Identity Flow Attributes for what each one contains.

    3. In the Summary tab, click Done.

  8. Back in the User-Session Creation tab, click Next.

  9. In the Protocol Settings tab, click Configure Protocol Settings.

    1. In the OpenID Provider Info tab, confirm the following:

      • Scopes: openid

      • Authorization Endpoint, Token Endpoint, and JWKS URL are filled in. If Load Metadata didn't fill them, use {issuer}/connect/authorize, {issuer}/connect/token, and {issuer}/.well-known/jwks.

      • OpenID Connect Login Type: Code

      • Authentication Scheme: Basic

      • Enable Proof Key for Code Exchange (PKCE): checked

      • Request Parameters: leave empty.

      • Click Next.

    2. In the Overrides tab, click Next.

    3. In the Summary tab, click Done.

  10. Back in the Protocol Settings tab, click Next, then click Done in the Summary tab.

  11. In the Browser SSO tab, click Next.

  12. In the Activation & Summary tab:

    • Make sure the connection is enabled.

    • Copy the Redirect URI and send it to your Twosense representative, who will register it for the identity client.

    • Click Save.

Auth Flow Setup

The auth flow verifies that the person at the workstation is who PingFederate expects, using behavioral trust and, if needed, an Imprivata badge tap. It runs on every workstation type. You'll create a second OpenID Connect IdP connection for it, using the auth client credentials from your Twosense representative.

Before you start, have these values from your Twosense representative ready:

  • The auth flow's Issuer (for example, https://idp.twosense.ai/acme-1234/auth)

  • The auth client's Client ID and Client Secret

Create the Auth Connection

Follow the steps in Create the Identity Connection, with these differences:

  1. In the General Info tab, use the auth flow's issuer and the auth client's credentials, and set Connection Name to Twosense Auth.

  2. In the Attribute Contract tab, add each of the following:

    • acr

    • amr

    • twosense_flow

    • upn

    • device_hostname

    • twosense_behavioral_result

    • twosense_stepup_result

    • imprivata_modality

    • imprivata_tapped_at

    • imprivata_assertion_id

    See Auth Flow Attributes for what each one contains.

  3. In the OpenID Provider Info tab, the endpoints use the auth issuer. Everything else is the same.

  4. In the Activation & Summary tab, copy this connection's Redirect URI and send it to your Twosense representative as well. Each connection has its own redirect URI, and each one is registered for its own client.

When you're done, both connections appear in the list:

Using Twosense in a Policy

How you use the two connections depends on the workstation type:

  • Shared (Type 2) workstations run the identity connection first to determine which user is signed in, then the auth connection to verify them.

  • Personal (Type 1) workstations already know who is signed in through Kerberos, so only the auth connection runs.

In both cases, the auth connection needs to know who it's verifying. PingFederate passes that user to Twosense through the auth node's Incoming User ID, and Twosense checks it against the person currently signed in at the workstation. The value must be the user's Active Directory SID (for example, S-1-5-21-…).

Always map your policy contract from Twosense Auth, never directly from Twosense Identity. The identity result identifies the user but doesn't verify them.

Shared Workstations

  1. Navigate to AUTHENTICATION and select Policies.

  2. Click Add Policy, or open the policy your shared workstations already use.

  3. Set Name to Shared Workstations (Twosense) or another descriptive name.

  4. Under Policy, select IdP Connections → Twosense Identity. If your policy starts with a selector (for example, one that matches your shared-workstation service accounts), put the identity connection on that selector's matching branch instead.

  5. Under the identity connection's Fail, choose what happens when Twosense can't identify the user. At this point nobody has been identified, so the fallback has to start by asking for a username, for example a login form.

  6. Under the identity connection's Success, select IdP Connections → Twosense Auth.

  7. Under Twosense Auth, click Options. Set Source to IdP Connection (Twosense Identity) and Attribute to sub, then click Done.

  8. Under the auth connection's Success, select your policy contract, then click Contract Mapping.

    1. In the Attribute Sources & User Lookup tab, click Next.

    2. In the Contract Fulfillment tab, map your contract's attributes from IdP Connection (Twosense Auth). For example, map subject to sub, acr to acr, amr to amr, and upn to upn. Click Next.

    3. In the Issuance Criteria tab, click Next.

    4. In the Summary tab, click Done.

  9. Under the auth connection's Fail, add your fallback. For example, to fall back to Duo:

    1. Select IdP Adapters → your Duo adapter.

    2. Click Options on the Duo node. Set Source to IdP Connection (Twosense Identity) and Attribute to upn (or whichever value matches your Duo usernames), then click Done.

    3. Under Duo's Success, select your policy contract and map it from IdP Connection (Twosense Identity), since the auth step didn't succeed.

    4. Under Duo's Fail, select Done.

  10. Click Done, then click Save on the Policies page.

The finished policy looks like this:

Personal Workstations

This example uses a Kerberos adapter as the first step.

  1. Navigate to AUTHENTICATION and select Policies, then click Add Policy or open your existing policy.

  2. Under Policy, select IdP Adapters → your Kerberos adapter.

  3. Under Kerberos's Fail, keep your existing login behavior.

  4. Under Kerberos's Success, select IdP Connections → Twosense Auth.

  5. Under Twosense Auth, click Options. Set Source to Adapter (Kerberos) and Attribute to ObjectSID, then click Done.

  6. Under the auth connection's Success, map your policy contract from IdP Connection (Twosense Auth), as in Shared Workstations.

  7. Under the auth connection's Fail, add your fallback. For Duo, set the Duo node's Incoming User ID to Adapter (Kerberos) → Username, and map the contract's subject from Adapter (Kerberos) → ObjectSID.

  8. Click Done, then click Save on the Policies page.

The finished policy looks like this:

Attribute Reference

Each flow returns its attributes in the ID token. These are the attributes you add to each connection's attribute contract, plus sub, which PingFederate includes by default.

Identity Flow Attributes

Attribute
Description
Example

sub

The user's Active Directory SID, taken from the signed Imprivata assertion. Pass this to the auth connection as its Incoming User ID.

S-1-5-21-1004336348-1177238915-682003330-51294

acr

Always urn:twosense:user-identity. It shows the user was identified, not verified.

urn:twosense:user-identity

amr

How the user started their Imprivata session, with one value per factor: pwd for a password and urn:twosense:imprivata-badge for a badge tap. Any other Imprivata method is reported as undefined.

["urn:twosense:imprivata-badge"]

twosense_flow

The flow that produced the token.

user-identity

upn

The user's UPN, in lowercase.

jsmith@acme.com

device_hostname

The Windows computer name of the workstation.

ACME-WS-1042

imprivata_assertion_id

The ID of the Imprivata assertion that identified the user. Use it to find the matching entry in Imprivata's audit log.

_2df2522868a8ecdbfa711b82c223c994

Auth Flow Attributes

The auth flow only returns a token when the user is verified. If Twosense denies the login, PingFederate receives an error instead and follows the auth node's Fail branch.

Attribute
Description
Example

sub

The user's Active Directory SID. It always matches the Incoming User ID that PingFederate sent.

S-1-5-21-1004336348-1177238915-682003330-51294

acr

How the user was verified: urn:twosense:verified when the behavioral check passed, or urn:twosense:verified-stepup when the user passed a step-up after the behavioral check failed.

urn:twosense:verified

amr

The methods used in this login: urn:twosense:behavioral, plus urn:twosense:imprivata-badge if the user tapped their badge for a step-up.

["urn:twosense:behavioral", "urn:twosense:imprivata-badge"]

twosense_flow

The flow that produced the token.

user-auth

upn

The user's UPN, in lowercase.

jsmith@acme.com

device_hostname

The Windows computer name of the workstation.

ACME-WS-1042

twosense_behavioral_result

The result of the behavioral check. It's reported even when a step-up later succeeded.

allow or deny

twosense_stepup_result

The result of the step-up. not-required means the behavioral check passed and no step-up was needed.

allow or not-required

imprivata_modality

The Imprivata method used for the step-up. Only present after a step-up.

prox_card

imprivata_tapped_at

When the step-up happened, from the Imprivata assertion. Only present after a step-up.

2026-09-15T22:41:58Z

imprivata_assertion_id

The ID of the Imprivata assertion for the step-up. Use it to find the matching entry in Imprivata's audit log. Only present after a step-up.

_7c41e9a05b3d48f2a61e0d9b8c27f513

Last updated