SAML/SSO with OneLogin

One of the SAML identity providers (IdP) you can use is OneLogin.

Before you set up OneLogin, read Understanding SAML/SSO for basic concepts and tips.

To set up SSO with OneLogin, you need:

  • A OneLogin account with admin permissions.
  • The Super Admin role in Hudu.
  • Matching email addresses: each user's email in OneLogin must match their Hudu account email exactly.
  • If Just-in-Time (JIT) provisioning is not enabled, create users in Hudu before they sign in with SSO. Hudu does not create accounts on SSO login unless JIT is enabled.

Just-in-Time (JIT) Provisioning

Hudu supports Just-in-Time (JIT) provisioning for users who sign in through SSO. On a user's first successful SSO login, Hudu can create their account from the attributes and group memberships sent during authentication.

    Visit Just-in-Time (JIT) Provisioning for additional information on enabling JIT provisioning in Hudu.

If you use JIT, also complete Adding User Attributes to SAML Assertion and optionally Assigning Roles via hudu_user_role.

How to Enable SSO in Hudu

Open the SAML settings in Hudu first, then configure OneLogin, then return here to paste the IdP values.

  1. Sign in to Hudu and open the Admin tab.
  2. Go to Security.
  3. Next to SAML/SSO, click Configure.
  4. Set Single Sign-On to On. (The page saves when you change Off/On.)
  5. Leave the IdP fields for now. Complete Configuring OneLogin, then finish Configuring Hudu and click Save.

Configuring OneLogin

  • In OneLogin, as an administrator:
    • Go to Applications → Applications.
  • Click Add App.

Add App in OneLogin Applications

  • Search for SAML and select SAML Custom Connector (Advanced).

SAML Custom Connector Advanced in OneLogin

  • Enter a name (and optionally icons and a description), then click Save.

Name the OneLogin SAML app

  • Open the Configuration tab. Replace docs.mywebsite.com with your Hudu hostname. Do not include a trailing slash on these URLs.
    • Audience (EntityID): https://docs.mywebsite.com
    • Recipient: https://docs.mywebsite.com/saml/consume
    • ACS (Consumer) URL Validator: a regex that matches your ACS URL, for example ^https:\/\/docs\.mywebsite\.com\/saml\/consume$
    • ACS (Consumer) URL: https://docs.mywebsite.com/saml/consume
    • Single Logout URL: https://docs.mywebsite.com (optional SP logout target; Hudu does not require a dedicated SLO endpoint)
    • Login URL: https://docs.mywebsite.com
    • Set SAML nameID format to Email if it is not already. Leave other defaults unless your OneLogin policy requires changes.
  • Open the SSO tab:
    • Set SAML Signature Algorithm to SHA-256.
    • Copy these values for Hudu:
      • Issuer URL
      • SAML 2.0 Endpoint (HTTP)
      • SLO Endpoint (HTTP)
      • X.509 Certificate

OneLogin SSO tab SAML signature algorithm

  • Click Save.
  • Assign the app to the users or groups who should sign in to Hudu with SSO.

Configuring Hudu

  • In Hudu, as a Super Admin, go to Admin → Security → Configure (next to SAML/SSO).
  • Enter the Identity Provider (IdP) values from OneLogin:
    • SAML Issuer URL: OneLogin's Issuer URL. Paste it exactly.
    • SAML Login Endpoint: OneLogin's SAML 2.0 Endpoint (HTTP). Paste it exactly.
    • SAML Logout Endpoint: OneLogin's SLO Endpoint (HTTP). Paste it exactly.
    • SAML Fingerprint:
      • Copy the X.509 certificate from OneLogin.
      • Paste it into OneLogin's fingerprint calculator.
      • Choose SHA-1 or SHA-256. If you choose SHA-256, check Use SHA-256 in Hudu. If you choose SHA-1, leave it unchecked.
      • Copy the formatted or unformatted fingerprint into SAML Fingerprint.
    • SAML Certificate: Paste the X.509 certificate from OneLogin exactly, including the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- lines. Do not leave a trailing space after the certificate.

   The Use SHA-256 checkbox applies to the fingerprint, not the certificate. The fingerprint algorithm you select in the calculator must match the checkbox in Hudu.

SAML ARN: Controls the requested authentication context Hudu sends to the IdP (RequestedAuthnContext). Choose the option that matches how your users sign in.

Do not pass RequestedAuthnContext

Hudu does not request a specific authentication method. Use this if any users sign in to OneLogin with passwordless methods.

urn:oasis:names:tc:SAML:2.0:ac:classes:Password

Requests that the IdP authenticate the user with a username and password.

urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport

Requests that the IdP authenticate the user with a username and password over SSL/TLS.

  • Click Save. You should see a confirmation that SAML was updated.

Testing SAML

  • Open an incognito or private window and go to your Hudu URL.
  • Enter the email of a user who should use SSO, then click Next. You should be redirected to OneLogin.
  • If you land in Hudu after authenticating, SAML is working.
  • Before you require SSO for non-admins, confirm every admin exists in OneLogin with the same email as their Hudu account and is assigned to the SAML app.

Additional Settings

Exempt groups from SSO

You can exempt groups from SSO. Members of exempt groups sign in with their Hudu password. Portal users are always exempt. Admins and above are offered a password option if SSO fails, so a broken SAML config does not lock out administrators.

If an admin cannot complete SSO and needs to sign in with a password, append /?sso_disabled=true to your instance URL (for example, https://docs.mywebsite.com/?sso_disabled=true). This break-glass page is for admins only.

SSO exempt groups settings in Hudu

Adding User Attributes to SAML Assertion

Use these parameters if you want OneLogin to send first and last name in the SAML assertion. Hudu uses them when creating users via JIT. Without these attributes, JIT-created users get the default names Provisioned / User.

  • In the OneLogin SAML app, open Parameters.
Add First Name
  • Click + to add a new parameter.
  • Set the parameter name to First Name.
  • Use http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname as the field / SAML attribute name.
  • Check Include in SAML assertion.
  • Click Save.
  • On the next screen, map the value to First Name, then click Save again.
Add Last Name
  • Click + to add a new parameter.
  • Set the parameter name to Last Name.
  • Use http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname as the field / SAML attribute name.
  • Check Include in SAML assertion.
  • Click Save.
  • On the next screen, map the value to Last Name, then click Save again.

OneLogin Parameters for first and last name SAML attributes

Assigning Roles via hudu_user_role

Optional for JIT. If OneLogin sends hudu_user_role, Hudu uses it when creating the user. Allowed values: spectator, editor, admin, super_admin. Legacy author is treated as editor. If the attribute is missing or unrecognized, Hudu uses the default JIT role configured in Hudu.

  • In the OneLogin SAML app, open Parameters.
  • Click + to add a new parameter.
  • Set the parameter name to hudu_user_role.
  • Leave the value blank if you will set it with Rules.
  • Check Include in SAML assertion, then click Save or Create.
  • Open Rules.
  • Click Create New Rule.
  • Build rules based on groups (or other conditions) to set hudu_user_role. Example: if the user is in Group A, set hudu_user_role to editor.
  • Save each rule.

OneLogin rule setting hudu_user_role

    For more on enabling JIT in Hudu, visit Just-in-Time (JIT) Provisioning.

FAQ

Why don't I see a Sign in with SSO button anymore?

Hudu routes every user by email. Enter your email on the login page and click Next. Hudu then sends you to your identity provider or asks for your password, depending on how your account is set up.

Single Sign-On Authentication Failed

This usually means the certificate fingerprint does not match. Confirm that Use SHA-256 matches the fingerprint algorithm you calculated, and that SAML Certificate is the same certificate used for that fingerprint.

Was this article helpful?
0 out of 0 found this helpful