2019-01-21 17:01:40 +00:00
[[_saml-general-config]]
2016-06-02 16:07:45 +00:00
2024-07-22 08:16:24 +00:00
== Configuration
2016-06-02 16:07:45 +00:00
2024-07-22 08:16:24 +00:00
The SAML client adapter is configured by a XML file `/WEB-INF/keycloak-saml.xml` placed inside the WAR deployment. The configuration might look like the following:
2016-06-02 16:07:45 +00:00
2017-08-30 07:26:56 +00:00
[source,xml,subs="attributes+"]
2016-06-02 16:07:45 +00:00
----
2016-11-09 10:02:53 +00:00
<keycloak-saml-adapter xmlns="urn:keycloak:saml:adapter"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2017-08-30 07:26:56 +00:00
xsi:schemaLocation="urn:keycloak:saml:adapter {saml_adapter_xsd_urn}">
2016-06-02 16:07:45 +00:00
<SP entityID="http://localhost:8081/sales-post-sig/"
sslPolicy="EXTERNAL"
nameIDPolicyFormat="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified"
logoutPage="/logout.jsp"
forceAuthentication="false"
isPassive="false"
2017-06-06 14:50:33 +00:00
turnOffChangeSessionIdOnLogin="false"
autodetectBearerOnly="false">
2016-06-02 16:07:45 +00:00
<Keys>
<Key signing="true" >
<KeyStore resource="/WEB-INF/keystore.jks" password="store123">
<PrivateKey alias="http://localhost:8080/sales-post-sig/" password="test123"/>
<Certificate alias="http://localhost:8080/sales-post-sig/"/>
</KeyStore>
</Key>
</Keys>
<PrincipalNameMapping policy="FROM_NAME_ID"/>
2016-12-04 20:44:53 +00:00
<RoleIdentifiers>
2016-06-02 16:07:45 +00:00
<Attribute name="Role"/>
2016-12-05 15:14:37 +00:00
</RoleIdentifiers>
2019-08-01 04:42:11 +00:00
<RoleMappingsProvider id="properties-based-role-mapper">
<Property name="properties.resource.location" value="/WEB-INF/role-mappings.properties"/>
</RoleMappingsProvider>
2016-06-02 16:07:45 +00:00
<IDP entityID="idp"
signaturesRequired="true">
<SingleSignOnService requestBinding="POST"
2022-02-08 13:07:16 +00:00
bindingUrl="http://localhost:8081{kc_realms_path}/demo/protocol/saml"
2016-06-02 16:07:45 +00:00
/>
<SingleLogoutService
requestBinding="POST"
responseBinding="POST"
2022-02-08 13:07:16 +00:00
postBindingUrl="http://localhost:8081{kc_realms_path}/demo/protocol/saml"
redirectBindingUrl="http://localhost:8081{kc_realms_path}/demo/protocol/saml"
2016-06-02 16:07:45 +00:00
/>
<Keys>
<Key signing="true">
<KeyStore resource="/WEB-INF/keystore.jks" password="store123">
<Certificate alias="demo"/>
</KeyStore>
</Key>
</Keys>
</IDP>
</SP>
</keycloak-saml-adapter>
----
2024-07-22 08:16:24 +00:00
You can use `${r"${...}"}` enclosure as System property replacement. For example `${r"${jboss.server.config.dir}"}`.
To get detailed information of the different elements in the XML configuration file see <@links.securingapps id="saml-galleon-layers-detailed-config"/>.
2016-06-02 16:07:45 +00:00
2024-07-22 08:16:24 +00:00
include::partials/saml/required_per_war_configuration.adoc[]
include::partials/saml/securing_wars.adoc[]
include::partials/saml/jboss-adapter-samesite-setting.adoc[]