Magnolia 5.3 reached end of life on June 30, 2017. This branch is no longer supported, see End-of-life policy.
The NTLM (NT LAN Manager) connector provides single sign-on (SSO) functionality for Windows systems within a trusted domain environment. The connector utilizes the Windows challenge/response authentication protocol to retrieve credentials from the Windows operating system and uses those credentials to log into Magnolia's CMS.
NTLM Connector is a Enterprise Edition module. You can download the module from our Nexus repository
The LDAP connector must be installed and the AD (Active Directory) connection should be verified to be working before proceeding with installing this module. The LDAP connector must be configured to connect to the host Windows system's domain controller and set to resolve users and groups from AD.
Optionally you can write your own ADRoleResolver
and resolve also roles from AD. Your ADRoleResolver
should implement the
NameResolver
interface.
To configure the module:
magnolia-module-ntlm
JAR file into the WEB-INF/lib directory in the webapp:/webapps/magnoliaAuthor/WEB-INF/lib
/server/default/deploy/magnoliaPublic/WEB-INF/lib
magnoliaAuthor
and magnoliaPublic
directories.magnoliaAuthor/META-INF
and magnoliaPublic/META-INF
directories.CATALINA_HOME/lib
. (Note: If you using Tomcat 6 you need use waffle-tomcat6
JAR; if Tomcat 7 then waffle-tomcat7
JAR. If you using a different version of Tomcat, see https://oss.sonatype.org)/content/repositories/releases/com/github/dblock/waffle/CATALINA_HOME/lib
. Note: These JARs (slf4j-log4j12, slf4j-api and jcl-over-slf4j) are located in the Tomcat installation directory in magnoliaAuthor/WEB-INF
and magnoliaPublic/WEB-INF
in Magnolia Enterprise Edition.ad.properties
file. (Note: ad.properties
is contained within the LDAP connector bundle and is typically in the directory WEB-INF/config/ldap.)Append the following code to jaas.config
in magnoliaAuthor/WEB-INF/config
and magnoliaPublic/WEB-INF/config
:
Jaas { waffle.jaas.WindowsLoginModule sufficient; };
Restart all instances. If context.xml
is removed after starting the instance, Tomcat needs to be forced to redeploy the application by removing all references from CATALINA_HOME/work/Catalina
and CATALINA_HOME/conf/Catalina
.
While this module logs in directly instead of going through JAAS, it does so by utilizing the Waffle Windows Authentication Framework. Waffle utilizes JAAS resulting in the need for the JAAS installation steps. Waffle's Servlet Negotiate Security Filter from the Waffle Framework was used for the implementation. This module works in connection with the LDAP connector module's AD authentication. Once SSO is enabled, only user accounts that exist in AD can be used to log into Magnolia. For this reason, there must be accounts with administrator rights in addition to the provided superuser account that exist in AD. Once installation is completed, NTLM will appear as a login filter in AdminCentral.
Add the login handler:
Node name | Value |
---|---|
server | |
filters | |
context | |
.... | |
login | |
loginHandlers | |
Basic |
|
NTLM | |
class | info.magnolia.module.ntlm.NTLMLogin |
Form |
Adding the waffle filter:
Node name | Value |
---|---|
server | |
filters | |
context | |
.... | |
registration | |
waffle | |
decoratedFilter | |
class | waffle.servlet.NegotiateSecurityFilter |
class | info.magnolia.module.ntlm.WaffleWrapperFilter |
enabled | true |
NTLM client callback:
Node name | Value |
---|---|
server | |
filters | |
context | |
.... | |
unicodeNormalization | |
securityCallback | |
clientCallbacks | |
ntlm | |
class | info.magnolia.module.ntlm.NTLMClientCallback |
Public | |
Form | |
class | info.magnolia.cms.security.SecurityCallbackFilter |
registration | |
waffle | |
login |
Adding external user manager:
Node name | Value |
---|---|
server | |
filters | |
IPConfig | |
i18n | |
security | |
userManagers | |
system | |
external | |
class | info.magnolia.cms.security.ExternalUserManager |
admin | |
public | |
groupManager | |
roleManager | |
class | info.magnolia.cms.security.SecuritySupportImpl |
security |
When SSO authentication is enabled to occur via Tomcat as described in the configuration, waffle will delegate the NTLM authentication to Tomcat. Tomcat performs server wide authentication in which all web applications on the instance share the authentication. When SSO authentication does not occur via Tomcat, the waffle authentication is utilized only by the Magnolia web application and is valid only within the Magnolia web container.
To avoid logged in users bypassing password requirement and changing identity:
Config:/server/filters/login/form
(info.magnolia.cms.security.auth.login.FormLogin) handlerinfo.magnolia.jaas.sp.jcr.JCRAuthenticationModule
and info.magnolia.jaas.sp.ldap.ADAuthenticationModulejaas
into separate jaas login chains. For example, add jaasChain
property to Config:/server/filters/login/ntlm/
with value magnolia-ntlm
. Then change your jaas.config to:magnolia { info.magnolia.jaas.sp.jcr.JCRAuthenticationModule required; info.magnolia.jaas.sp.jcr.JCRAuthorizationModule required; }; magnolia-ntlm { info.magnolia.jaas.sp.ldap.ADAuthenticationModule required realm=external; info.magnolia.jaas.sp.jcr.JCRAuthorizationModule required; }; Jaas { waffle.jaas.WindowsLoginModule sufficient; };