SAML 2.0

Spinnaker supports using a SAML identity provider for single sign-on authentication.

Security Assertion Markup Language (SAML) is an XML based way to implement single sign-on (SSO).

A cryptographically signed XML document (known as a “SAML Assertion”) is sent to the API gateway server (Gate) with your identifying information, such as username and group membership.

Gate verifies the XML document’s signature using a metadata file, and if successful, it associates the identifying information with the user and allows the user to proceed as authenticated.

Identity provider setup

  1. In your SAML Identity Provider (IdP), download the metadata.xml file. Some providers expose this as a URL. It may look something like this:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
        <md:KeyDescriptor use="signing">
          <ds:KeyInfo xmlns:ds="">
  2. Create a Spinnaker SAML application.

  3. Specify the login URL as https://localhost:8084/saml/SSO. Replace “localhost” with Gate’s address, if known.

  4. Specify a unique entity ID (we’ll use spinnaker.test in our example).

  5. Enable the users you’d like to have access to your Spinnaker instance.

  6. Generate a keystore and key in a new Java Keystore with some password:

    keytool -genkey -v -keystore saml.jks -alias saml -keyalg RSA -keysize 2048 -validity 10000
  7. Execute the following halyard commands and redeploy Gate:

    KEYSTORE_PATH= # /path/to/keystore.jks
    METADATA_PATH= # /path/to/metadata.xml
    hal config security authn saml edit \
      --keystore $KEYSTORE_PATH \
      --keystore-alias saml \
      --keystore-password $KEYSTORE_PASSWORD \
      --metadata $METADATA_PATH \
      --issuer-id $ISSUER_ID \
      --service-address-url $SERVICE_ADDR_URL
    hal config security authn saml enable

Network architecture and SSL termination

During the SAML workflow , Gate makes an intelligent guess on how to assemble a URI to itself, called the Assertion Consumer Service URL. Sometimes this guess is wrong when Spinnaker is deployed in concert with other networking components, such as an SSL-terminating load balancer, or in the case of the Quickstart images, a fronting Apache instance.

To override the values to assemble the URL, use the following hal command:

hal config security authn saml edit --service-address-url

Please check on the SSL Documentation for more information.

For the Quickstart images, append /gate to the --service-address-url. All other configurations can omit this setting.


The SAML workflow below reflects the process when the user navigates to Spinnaker first, is redirected to the SAML IdP for login, and redirected back to Spinnaker. Some SAML providers will allow the user login to the SAML provider first, and click a link to be taken to Spinnaker.

sequenceDiagram participant Deck participant Gate participant IdentityProvider Deck->>+Gate: GET /something/protected Gate->>-Deck: HTTP 302 to https://idp.url/?SAMLRequest=... Deck->>+IdentityProvider: GET https://idp.url/?SAMLRequest=... IdentityProvider->>-Deck: Returns login page
  1. User attempts to access a protected resource.

  2. Gate redirects to the SAML provider, passing a few query params:

    • SAMLRequest: a Gzip’ed XML authentication request.
    • SigAlg: The algorithm used to generate the Signature parameter.
    • Signature: A digest of the SAMLRequest using the SigAlg algorithm and the server’s key.

    Within the SAMLRequest is the Assertion Consumer Service URL, with is the URL to your Gate instance. See here for how to override this value.

  3. SAML provider prompts user for username & password.

    sequenceDiagram participant Deck participant Gate participant IdentityProvider Deck->>+IdentityProvider: User sends credentials IdentityProvider->>-Deck: HTTP 200 with self-submitting form to POST https://gate.url Deck->>+Gate: POST /saml/SSO with { SAMLResponse: ... } Note right of Gate: User identity verified Note right of Gate: Gate extracts data based on userInfoMapping Gate->>-Deck: HTTP 302 /something/protected

  4. A SAML response must be POSTed to /saml/SSO, and most browsers won’t re-POST when given an HTTP 302. Instead, providers sometimes return a page (with HTTP 200) that has a self-submitting HTML form to POST to Gate’s /saml/SSO endpoint.

  5. Gate verifies the message’s integrity by checking its signature, and thus verifying the user’s identity information.

  6. Gate determines the username and/or email address, and optionally extracts group membership (if sent by the IdP).

  7. With the user’s identity verified, Gate redirects the user to the originally requested URL.

Next steps

Now that you’ve authenticated the user, proceed to setting up their authorization .


Last modified May 4, 2021: rest of migration (700781a)