Skip to main content

SAML

Knocknoc supports up to six identity providers for user logins, and one provider of its own for the admin portal. Separating the admin provider reduces the attack surface of the user-facing application, reducing escalation risks.

SAML in Knocknoc

  1. User and Admin SAML are intentionally separate. This is a security feature. Do User first.
  2. Follow the provider specific guide: Entra, Okta, Authentik, Shibboleth, etc.
  3. Configure Assertions: Customize the assertions to include the necessary user information, this can include sending group information and/or static assertions.
  4. Test the SAML Flow: Ensure that the authentication flow works as expected. Knocknoc has built-in SAML testing in the Settings page for Admins.

Configuring SAML

Settings -> Authentication opens with a summary of every sign-in method, so you can see the current state at a glance: local password login (with a count of how many users and admins have MFA), LDAP, and the User and Admin SAML integrations (Configured or Not configured, plus the admin provisioning mode).

Authentication settings summary showing SAML certificate expiry

User SAML versus Admin SAML

Knocknoc keeps user and admin identities separate. The admin portal has one identity provider of its own, and user logins can have up to six. The two sign-in flows provision accounts differently:

  • Users are provisioned automatically on first sign-in. A user's Knocknoc group membership, and therefore the Knocs they can reach, is derived from the group values their assertion carries.
  • Admins can be provisioned in either of two ways, configured under Settings -> Authentication -> Admin provisioning: by being pre-created in the admin portal, or by membership of a nominated SAML group. At least one of these must be enabled. See Admin provisioning below.

Testing your SAML configuration

Knocknoc can run a live SAML round-trip against your identity provider without creating a user or a session, so you can confirm the integration and see exactly what the IdP sends before relying on it. All tests are launched by a signed-in admin from Settings -> Authentication, and run against your saved configuration, so save any changes first.

  • Test SAML sits at the top of both the User and Admin SAML boxes. It signs you in through the relevant identity provider and returns to a result dialog showing the NameID and every attribute the IdP returned. The user test additionally lists the Knocknoc groups that user would be assigned on login.
  • Test SAML group sits inside the Admins assigned to a SAML group option. In addition to the round-trip, it reports whether your account is in the configured admin group and shows the exact group attribute and values received: the quickest way to discover the right values to enter.

Each test redirects you through the IdP and back to a result dialog. The raw attributes are collapsed and expandable. Because no session is created, the tests are safe to run at any time and never log you in as the tested identity.

A failed test names the cause and what to change, so work from the message in the dialog.

SAML-only mode, disabling local users

Settings > Authentication > User SAML has a Disable local user login (SAML only) tick box. With it on, visitors to the user login page are sent straight into the SAML flow. Both local password and LDAP logins are disabled, so users can only sign in via SAML SSO. Turn it off again whenever local sign-in is needed.

Pair it with a knoc’s Skip the Knocknoc dashboard option, under User Experience (Redirections). That sends the user on to the service they asked for rather than leaving them on the dashboard with a four-second countdown. The two together take someone from a link to the service with one sign-in and nothing to click.

The Disable local user login tick box

Multiple User identity providers

Providers are added under Settings -> Authentication, up to six. Configuring more than one requires an Enterprise license, and a license that lapses stops the extra login buttons appearing. Each provider is named, and that name is the label on its button on the login page.

Each provider is set up separately at its own end, and they do not share addresses. Once you save, that provider's own Metadata / Entity ID and Reply URL (ACS) appear beside it. Register those with that provider, not the first one's. Each provider also gets its own signing certificate.

The Identity providers section of the user SAML settings, with two providers configured. Each has its own name, metadata URL, Test SAML button and signing certificate, and its own Metadata / Entity ID and Reply URL (ACS) to register at that provider

A username belongs to the provider that asserted it, so "alice" from one directory and "alice" from another are two accounts with their own groups and access. A provider asserting a name it has not seen before creates an account rather than signing in to somebody else's.

Groups are scoped the same way. A SAML or dynamic group names the providers whose assertions it matches, so one directory's "CanSSH" is not the other's, and a group can instead be set to match any provider including ones added later. See Create groups.

Deleting a provider leaves the accounts it owned in place rather than handing their names to the next provider that asserts them, which is the takeover this separation exists to prevent. Delete those accounts yourself if you want the names released.

Available assertion configuration

A user identifier and any groups are the minimum required. The user identifier can be anything, an email address, UUID or other. Group membership must be passed in the "groups" attribute. Below are the minimum and optional assertions:

Minimum assertions

Assertion

For

Used For

NameID Users & Admins The username. Any stable, unique value works, such as an email or an object ID. Keep it the same over time, because a changed NameID signs the person in as a new account.
groups Users Gives the user their Knocknoc SAML groups, which decide what they can access. Sent on every login. A login with an empty groups array removes the user from all groups.

Note: Attribute names are not case-sensitive, so realName, RealName and realname are all treated the same.

Optional assertions

Assertion

For

Used For

realName Users & Admins The display name shown in Knocknoc. Recommended when the NameID is an ID instead of an email.
groups Admin Signs in, and creates if needed, any admin who is a member of the configured admin group.
company Users The company shown on the user's profile.
sessionDuration Users How long a session lasts, in minutes. The default is 420 (7 hours).
sessionDurationOverride Users How long a session lasts, in minutes, taking precedence over sessionDuration. Knocknoc also writes it to the user’s account, so it applies to an existing user as well as a new one.
sessionLimit Users The most sessions the user can have open at once. It can't go above your license's limit.
allowPersistentIPs Users true lets the user register persistent IP devices.
allowAgenticAccess Users true lets the user use agentic access.

If your identity provider encrypts assertions, set its key encryption algorithm to RSA-OAEP. Knocknoc refuses the older RSA1_5.

Debug assertions

Debug assertions, in Settings -> Authentication, stores the assertion of every SAML login for the next four hours, with the session it opened, so you can see which groups it assigned and why. While it runs the button reads Recording SAML assertions until a given time, with Stop beside it. Each assertion appears on its session’s SAML tab. The signature is not kept, so a stored assertion cannot be used to sign in.

SAML session duration

A user's session length can be driven by the SAML assertion. For a new user, Knocknoc uses an explicit per-user override if one is set, otherwise the duration supplied in the assertion, otherwise a default of 420 minutes (7 hours). For an existing user, if the identity provider omits the duration attribute Knocknoc keeps that user's already-configured duration rather than resetting it.

Admin provisioning

Once admin SAML metadata is configured, Settings -> Authentication -> Admin provisioning controls which SAML users are allowed in as admins. Select at least one option:

  • Predefined SAML Admins (default): only users that already exist as admins in Knocknoc can sign in.
  • Admins assigned to a SAML group: any user whose assertion carries the configured group is signed in, and is created as an admin automatically the first time they log in. You configure:
    • Admin group: the group value your IdP sends that grants admin access. Matched case-insensitively.
    • Group attribute name: the SAML attribute that carries group membership. Defaults to groups, the same attribute used for user groups.

Group membership is re-checked on every login. A user who loses the group (or, once group mode is turned off, who is not also a predefined admin) is refused at the next login. Their admin account is left untouched: Knocknoc does not disable or delete it, the user simply cannot sign in until they regain access. The refused user sees a clear message on the admin login page ("Access refused: your account is not a member of the required SAML group. Contact an administrator."). The message is deliberately generic and does not indicate whether the account exists.