Single sign-on (SSO) to an external application

The management application of John Smith Ltd (erp.johnsmith.test, published in the scenario Publishing an internal site) has its own user directory with separate passwords: every time someone…

Situation

The management application of John Smith Ltd (erp.johnsmith.test, published in the scenario Publishing an internal site) has its own user directory with separate passwords: every time someone arrives or leaves, you must remember to touch the application too, and passwords go around on slips of paper. But the application can do SAML 2.0.

The goal: whoever opens the application is sent to Atlas’s sign-in page, signs in with domain credentials and the second factor (or, from a PC in the domain, without typing anything), and comes back to the application already recognised. Only the group administration (Jack Green and Julia Brown) must be able to get in; Paul Black (production) must not.

Atlas acts as the SAML identity provider (IdP); the application is the service provider (SP). How single sign-on works as a whole is in Fundamental concepts; the applications page, with all its fields, is in the chapter Web.

What you need

  • The single sign-on (SSO) module installed (System → Modules, «Single sign-on (SSO)» tab). Without the module Web → SAML applications does not appear, or the page says «Single sign-on is not on.»
  • The public name of the SSO reachable from the users’ browser: it is the mail server’s name, atlas.johnsmith.test, and it must be in the public DNS with ports 80/443 open (scenario 30, “Making 80 and 443 reach the appliance”). The SSO’s addresses derive from that name.
  • An Atlas administrator (lwhite) and an administrator of the application, because data must be pasted on both sides.
  • That every person who will use the application from outside has already enrolled the second factor’s token (Tools → MFA enrollment, from the internal network or the VPN). From the inside it is not needed: PCs in the domain sign in with Kerberos.
  • In the application, the page where SAML sign-in is configured (it is called in different ways: «Single Sign-On», «SAML», «External identity provider»).

Warning Single sign-on imposes the OTP code on anyone who signs in with a password, administrators included. If you do not yet have lwhite’s token, enrol it before turning the module on, otherwise to get back in you will have to use the internal network (emergency sign-in /login?local=1) or a PC in the domain.

Steps

Checking the module and the PCs

  1. Open Web → SAML applications. If the page shows the list and the «Register application» icon, the module is there. If it says «Single sign-on is not on», install it: System → Modules, «Single sign-on (SSO)» tab, «Next», leave «Address» as it is, keep «Automatic sign-in from domain PCs» on, «Deploy». If the warning about the «Edon - SSO intranet» GPO or the Kerberos keytab appears, follow the instructions in the Active Directory domain block of the SSO settings.
  2. To let the PCs in the domain sign in without typing anything, the browsers must send the Kerberos ticket: the «Edon - SSO intranet» GPO, created by Atlas, puts the server in the Intranet zone of Edge and Chrome and in Firefox’s Kerberos lists. The PCs must resolve atlas.johnsmith.test with the appliance’s address (scenario 30, steps 13 and 14, or the internal DNS). If you do not do this, sign-in works all the same, with password and code.

Taking the application’s data

  1. In the application open the SAML sign-in page and look for the application’s metadata (SP metadata): an XML file to download or an address that returns it. Here the application is on a private network (192.168.10.41:8080): Atlas cannot download the metadata from an internal address, nor from a name that resolves to an internal address. So download the XML file with your browser and keep it open.
  2. If the application does not publish the metadata, note instead its Entity ID and the ACS address (where it receives the outcome of the sign-in, necessarily https://…): in step 6 you will see how to register it «By hand».

Registering the application in Atlas

  1. In Web → SAML applications press the «Register application» icon. A window opens with two buttons at the top, «From metadata» and «By hand».
  2. Choose «From metadata». «Name»: ERP (it is the name shown in the console and on the choice page, at most 100 characters). Paste the content of the XML file in «Or paste the metadata XML». Leave «Metadata address» empty: if you fill in both, the XML wins. Press «Register».
    • Without metadata: choose «By hand», «Name» ERP, «Application entity ID» (3–512 characters, no spaces), «ACS URL (where the application receives the sign-in)» (https://…), then «User identifier (NameID)» and «Register».
  3. The application appears in the list and is selected. If «An application with this entity ID is already registered.» appears, there is already a row with the same Entity ID: edit it instead of creating another.

Giving the application Atlas’s data

  1. Deselect the application: on the right the «Details to enter in the application» panel appears, with «Metadata address», «Entity ID (issuer)», «Sign-in and sign-out URL» and «Signing certificate», each with the «Copy» icon.
  2. In the application’s SAML page paste the Metadata address (most applications read everything from there). If the application cannot read an address, paste the three values separately: Entity ID, sign-in and sign-out URL, signing certificate. The response and the assertion are signed.
  3. In the application choose how to identify the user: the email address or the user name. It must match step 11.

Choosing what is sent and to whom

  1. Reselect ERP in the list. In the «Application» block, «User identifier (NameID)» has two values: «E-mail address» (default) and «User name». The application has the users jgreen and jbrown as names, so choose «User name». If the application uses addresses, leave «E-mail address»: the address is the one in the user’s page in Active Directory → Users (jgreen@johnsmith.test).
  2. In the «Attributes sent» block leave the default names: «User name» uid, «E-mail» email, «First name» givenName, «Last name» sn, «Groups» groups. Change them only if the application’s documentation asks for others; an empty field goes back to the default, and the names cannot have spaces.
  3. In the «Who may sign in» block choose administration from «Pick a group». With no groups all the domain’s users get in; with one or more groups, only their members (also through nested groups).
  4. Press «Save» at the bottom. «Application saved» appears. If instead you see «The change was saved, but the sign-in server did not apply it: try again shortly.», wait a moment and press «Save» again.
  1. Normally the user starts from the application. If you want a link to put on an internal page, open System → Settings → Single sign-on (SSO), turn on «Sign-in started from the portal» (off by default) and press «Apply». In the application’s detail «Direct sign-in link» appears, to copy with «Copy».

Check

  • In the list the ERP row has the padlock (limited access) and says administration in the groups; no amber warning.
  • With a private window, open https://erp.johnsmith.test/ as jgreen: the application sends you to Atlas’s sign-in page; type user and password and then the OTP code (or use the passkey); you return to the application recognised as jgreen. From a PC in the domain, with the GPO applied, you type nothing.
  • Try with pblack (group production): Atlas refuses the sign-in and does not send him to the application.
  • If you want to check what the application receives: in its log, or in the user’s profile page, uid, email, givenName, sn and groups must appear with the names from step 12.
  • Add pblack to the group administration in Active Directory → Groups and sign out and back in with a new private window: he should get in. Remove him and try again: refused again. If the outcome does not change right away, retry after a few minutes: the times at which the sign-in server rereads the groups are not documented.

If something goes wrong

What you see What it means What to do
«The metadata could not be downloaded from that address.» URL unreachable, too slow (10 seconds), too big (1 MB) or on an internal address Download the XML with the browser and paste it in the proper field
«The metadata is not valid.» / «The metadata does not describe a SAML application.» The XML cannot be read, or it is of another kind (for example the metadata of the application’s IdP) Take the application’s (SP) metadata, not those of a provider
«An application with this entity ID is already registered.» Duplicate Edit the existing application, or delete it and register it again
«Check the highlighted fields.» A field is empty or invalid («Required» under the field) Correct it
Amber row «Nobody can sign in» or «No effect: …» The chosen group is not found by the sign-in server Check the name in Active Directory → Groups or remove the group; if none of the groups exists the application lets nobody in
«Who may sign in»: the group “…” is not in the directory, or the directory is not answering The group does not exist or the domain controller does not answer Choose among the groups in the list; check the domain’s state
«The application no longer exists.» Another administrator deleted it Reload the page
The application says “unknown user” NameID different from what the application knows Step 11: choose between user name and email address
The user is in the group but is refused The group was renamed in Windows: Atlas looks it up by common name (cn), the selector shows sAMAccountName Reselect the group; for groups created by Atlas the two names coincide
No sign-in from outside The user has no token, or the SSO’s name cannot be reached from outside MFA enrollment from the inside; scenario 30 for the ports

Variants

One application for all employees, another only for management

The scheme is the same, only «Who may sign in» changes. The company’s web address book, for example, is open to everyone: register the application and choose no group (in the list the row says «Every user of the domain»). The payroll application is only for management: register it and choose the group management in «Who may sign in». The two applications are independent: each has its own Entity ID, its own group and its own attributes, and signing in to one does not open the other.

Google Workspace, registered by hand

Google does not publish the application’s metadata, so «By hand» is used: «Name» Google Workspace; «Application entity ID» google.com/a/johnsmith.test; «ACS URL (where the application receives the sign-in)» https://www.google.com/a/johnsmith.test/acs; «User identifier (NameID)» «E-mail address»; «Register». In Google’s admin console, in the third-party SSO page, enter «Sign-in and sign-out URL» and «Signing certificate» from the «Details to enter in the application» panel; the metadata address is not needed. Check with jsmith: opening https://mail.google.com/a/johnsmith.test sends him to Atlas and he returns to Google authenticated. If Google says the user does not exist, the user’s email address in Active Directory → Users is not in the domain johnsmith.test: the «E-mail address» NameID sends that one.

Changing the attributes the application expects

If the application’s documentation wants the surname in family_name instead of sn, open the «Attributes sent» block and type family_name in the «Last name» field. The other fields stay at their default names. The new name applies from saving; emptying the field restores the default.

What the user sees

  • From a PC in the domain, in the office, with the «Edon - SSO intranet» GPO applied: they open the application and get in without typing anything (Kerberos sign-in).
  • From another PC, or from outside: the application sends them to Atlas’s sign-in page; they type user and password and then the OTP code, or choose the passkey.
  • A user outside the group: sign-in is refused by Atlas and does not reach the application.
  • From Atlas’s console nothing changes: console sign-in follows its own rules (chapter First sign-in and using the console).

Checklist before saying “done”

  1. The «Single sign-on (SSO)» module is «Configured» and the name atlas.johnsmith.test can be reached from outside.
  2. The application is registered, with the right Entity ID and ACS URL.
  3. The application has Atlas’s metadata address (or the three values) and uses the same NameID chosen in Atlas.
  4. «Who may sign in» contains administration, and no amber warning appears in the list.
  5. A test with a user of the group succeeds and one with a user outside the group is refused.
  6. Every person who must sign in from outside has an «active» token.

Things to know

  • Deleting the application («Delete application» icon, with confirmation) stops everyone from using single sign-on until you register it again; on the application side it needs reconfiguring only if the Entity ID or ACS URL change.
  • If you change the appliance’s internet name (System → Settings → Hosts), the SSO’s addresses change and all applications must be reconfigured with the new metadata.
  • The application receives only the five attributes in the table: nothing else about the user.
  • The application does not know the domain password: after single sign-on, functions that act as the user on the domain (mail via browser, files, Caveau) ask for the password once per session in Atlas, not in the application.
  • If the SSO does not answer, the sign-in page of Atlas’s console falls back to the password form, so that the administrator can repair it. SAML applications, instead, stay stopped until the SSO comes back.
  • Single sign-on to Google Workspace is registered «By hand» (Google does not publish the metadata): the case is a complete example in the chapter Web. Microsoft 365, which federates a whole domain, is not among the supported applications.

For the technician Each application is a SAML client of Keycloak’s edon realm (marked edon.saml=1); with access limited to Atlas groups, it creates a role edon-app-<slug> assigned to the chosen groups and a sign-in flow of its own that refuses whoever does not have it. There is no second store: the dump of the sso database is enough for the backup. Keycloak’s admin console is never used.

LET’S TALK INFRASTRUCTURE

Control starts with a conversation.

Tell us about your infrastructure. Let’s start with what you actually need.

Talk to an engineer