Skip to content
Workforce IdentityMarkdown

Share one sign-in across every host name

A realm reached under several host names can share one sign-in across them, and present one issuer to every app.

API

A realm can be reached under more than one host name, such as a regional name beside a global one: foobar.cvyuh.com and foobar-eu.cvyuh.com. You can give users one session across those names, and give every app the same issuer, whichever name it uses.

Before you start:

  • Who can do it: a realm administrator, in a group that holds RealmOwner (Delegated administration). RealmViewer can read the settings but not change them.
  • Where: today this is done through the API; Call the API shows how to get $CVYUH_SESSION.
  • First: the realm answers on each host name, as Hostnames describes.

One session, where the cookie reaches. The session cookie is set only on the host the user signed in on, unless the platform names cookie domains (cookieDomains). Host names under one of those domains share the session: signed in on one, signed in on all, and one sign-out ends it everywhere. Host names under different domains each sign the user in separately.

One issuer, if you want it. By default each host name is its own issuer, so an app using foobar-eu.cvyuh.com sees tokens from https://foobar-eu.cvyuh.com/oauth2. With a base URL set, every app sees the same issuer, and the discovery document, its endpoints, the issuer in tokens and the return links are all built on that one address. Host names that differ only in letter case or port are already the same issuer.

Your apps…Base URL
each use one host nameNot needed
may use either host name, and check the issuerSet it
call APIs that trust exactly one issuerSet it
  1. Check the realm answers on each host name. Each one serves its own discovery document:

    Terminal window
    curl https://foobar-eu.cvyuh.com/oauth2/.well-known/openid-configuration
  2. Set the base URL:

    Terminal window
    curl 'https://foobar.cvyuh.com/api/v0/am/objects/v1/baseUrl?id=baseUrl' \
    -H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \
    -H "Content-Type: application/json" \
    -d '{ "url": "https://foobar.cvyuh.com" }'

    It must be an https origin: lower-case host, an optional port other than 443, no path, no trailing slash.

Open https://foobar.cvyuh.com/oauth2/.well-known/openid-configuration and https://foobar-eu.cvyuh.com/oauth2/.well-known/openid-configuration. With a base URL set, both show the same issuer.

SymptomCauseFix
Saving the base URL is refusedIt isn’t an https origin: upper-case letters, port 443 written out, a path or a trailing slashWrite it as https://foobar.cvyuh.com
Users sign in again on the second host nameThe host names aren’t under one cookie domainExpected: a base URL shares the issuer, not the session
An app rejects tokens after the changeIt checks the old issuerUpdate the app’s issuer to the base URL

PATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/baseUrl/baseUrl with a new url.