Legacy Knowledge Base
Published Jul. 2, 2025

Implementing NTLM Seamless Login

Written By

Brett Ripley

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

While we make every effort to ensure this Knowledge Base is accurate, itmay not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with anyfeedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

Before using any information from this article, independently verify itssuitability for your situation and project.

This article is a legacy article. It applies to previous versions of the Liferay product. While the article is no longer maintained, the information may still be applicable.

After successfully configuring Liferay with NTLM, a user can authenticate simply by clicking "Sign In" within Liferay. While this is certainly a nice feature, there may be an additional requirement to extend the NTLM integration so that users are authenticated automatically when they navigate to any page in the portal.

To achieve this, there is a straight-forward solution of modifying a section of the liferay-web.xml, and a change to NTLMFilter.java. Please note that this is a customization and is not supported by Liferay Support.

Resolution

In order to implement seamless integration (or auto-login as some refer to it), there are changes to two files: liferay-web.xml and NTLMFilter.java.

  1. liferay-web.xml
    Liferay-web.xml is a file that controls the filters that run when certain URLs on the portal are accessed. Change the file so the NTLM filter runs on every page of the portal instead of just on the login page.
     
    In the filter-mapping section for SSO Ntlm Filter, change <url-pattern>/c/portal/login</url-pattern> to <url-pattern>/*<url-pattern>. The result will look like this:
     
    <filter-mapping>
    		<filter-name>SSO Ntlm Filter</filter-name>
    		<url-pattern>/*<url-pattern>
    		<dispatcher>FORWARD</dispatcher>
    		<dispatcher>REQUEST</dispatcher>
    		</filter-mapping>
    	
  2. NTLMFilter.java contains the class that is called when the NTLM filter runs. Make the following change so that the class so that the class runs on all pages except logout pages.
     
    Change:
    if (path != null && path.endsWith("/login")) { 
    to
    if (path != null && 
    !(path.endsWith("/guest/home") || path.endsWith("/portal/logout") || path.endsWith("/portal/layout"))
    ) {
     
    Now, instead of only running the filter on the login page, the filter will run on all pages with the exception of the logout pages.
Did this article resolve your issue ?

Legacy Knowledge Base