Web Agents

Cross-domain single sign-on

Cross-domain single sign-on (CDSSO) is an AM capability that lets users access multiple independent services from a single login session, using the agent to transfer a validated session ID on a single DNS domain or across domains.

Without AM’s CDSSO, SSO cannot be implemented across domains; the session cookie from one domain would not be accessible from another domain. For example, in a configuration where the AM server (am.example.com) is in a different DNS domain than the web agent (myapp.website.com), single sign-on would not be possible.

Web Agent works in CDSSO mode by default, regardless of the DNS domain of the AM servers and the DNS domain of the web agents.

Learn more in Single sign-on and Implement CDSSO in AM’s Authentication and SSO guide.

Reuse an AM session from another domain

When multi-page applications on several DNS domains each authenticate users through their own agent proxying requests to the same AM deployment, a user who has already signed on in one domain must sign on again when they arrive at another domain. The session cookie set by the first domain isn’t visible to the second domain.

Configure the SSO Probe URLs property to let agents reuse an existing AM session from other domains. When the property is set, an unauthenticated user who arrives at an agent can be authenticated silently with a session established through a peer domain, without signing on again and without sharing cookies across domains.

This feature is for multi-page applications that navigate between pages. Don’t use it for single-page applications, because the probe flow redirects the browser away from the application.

Configure session reuse across domains

The following example shows an AM deployment shared by three applications, each protected by a Web Agent on a different DNS domain:

  • app-a.example.com

  • app-b.example.com

  • app-c.example.com

Each domain exposes AM through its own reverse proxy, so that the browser always sends same-site requests to the domain serving the application.

In the local agent.conf file of each agent, set SSO Probe URLs to the oauth2/authorize endpoints of the other domains. For example, on the agent protecting app-a.example.com:

org.forgerock.agents.config.sso.probe.url = https://app-b.example.com/am/oauth2/authorize https://app-c.example.com/am/oauth2/authorize

When a user arrives at app-a.example.com without a session, the agent checks app-b.example.com, then app-c.example.com, and then redirects the user to sign on as usual.

Session reuse with a custom login application

When the agent uses a custom login application, a user can sign on in a second browser window while the first window still displays the login form.

To let the agent reuse the session established in the second window, redirect the browser to the callback URL from the goto parameter, appending abandoned=true. The agent starts a new session-reuse check. If it finds the session, it authenticates the user and redirects the browser to the originally requested resource without another sign-on.