SAML Configuration
saml
in security.conf
:pom.xml
file. If an existing security provider is configured (an artifactId
starting with twigkit.security.provider
), replace the existing dependency with this dependency:src/main/resources/conf/security/saml.conf
. Add this content:
sso-url
: Configure application’s login failure redirect endpoint (SSO URL).
slo-url
: Configure application’s logout success redirect URL (SLO URL). Typically this is the URL at the IdP which triggers ‘Single Logout’ (SLO), logging out the user from the IdP system entirely.
entity-id
: Define the SP (partner) entity ID for this application (as configured in the IdP backend). If not already defined, choose a unique identifier to use to refer to this SP and provide this to the IdP.
src/main/resources
directory. You can if necessary also configure a custom metadata XML file location using:idp-metadata-file
: path of the IdP metadata file relative to src/main/resources
(defaults to ‘idp-metadata.xml’).The majority of IdPs provide this metadata export functionality. In this case, we are using PingFederate (see the screenshots below).In the PingFederate admin UI, choose Administrative functions > Metadata Export.src/main/resources/samlKeystore.jks
.In the case of SP initiated SSO, you will also must upload the keys used by the SP to sign SAML requests to the IdP system’s trusted certificate store.saml.conf
.
Protocol: SAML 2.0
Browser SSO: true
IdP initiated SSO & SLO: true
Assertion consumer service endpoint URL: (POST or Artifact) http://your-twigkit-host/your-twigkit-app/saml/SSO
SLO service URL: (POST) http://your-twigkit-host/your-twigkit-app/logout/
Artifact resolver location: http://your-twigkit-host/your-twigkit-app/saml/SSO/
http://localhost:8080/
).
You should be presented with the IdP’s login form; see the example below:
defaultFailureUrl
property from the unauthenticatedRedirectHandler
bean.saml.conf
to change the behavior of the SAML module:
metadata-display
: set to ‘metadataDisplayFilter’ and you will be able to download an SP metadata XML file at http://your-twigkit-host/your-twigkit-app/saml/metadata
. Thid id useful for debugging, but should be removed for production deployments because it exposes information about the authentication protocol.
saml-keystore-file
: location of the keystore file to use for checking trust and identity of the IdP and SP security certificates
key-alias
: the alias of a key in the keystore to use as the default SP security key
key-password
: password for the keystore and the key defined under using ‘key-alias’ (must match)
max-authentication-age
: a TTL for the authentication in seconds, useful if the authentication expires at the IdP end prior to the default which is 7200 seconds.
response-skew
: a time window in seconds to accept initial SAML responses from the IdP. This is useful if the IdP server and application server are on different timezones.saml.conf
with the respective connection values for your load balancer:
server-scheme
: The load balancer’s communication protocol (for example, http)
server-name
: The load balancer’s host name (for example, search.twigkit.com)
server-port
: The load balancer’s port number
entity-base-url
: A full URL for the load balancer (for example, http://search.twigkit.com)