Skip Ribbon Commands
Skip to main content
Navigate Up
Sign In

Quick Launch

Average Rating:

facebook Twitter
Email
Print Bookmark Alert me when this article is updated

Feedback

ERROR: "UsernamePasswordAuthenticationFilter: An internal error occurred while trying to authenticate the user. org.springframework.security.authentication.InternalAuthenticationServiceException: Failed to parse DN;"
Problem Description
After configuring LDAP configuration for PMPC, while logging "Invalid credential" error used to pop-up. In rulepoint.log file, we get the below error:

[ERROR] UsernamePasswordAuthenticationFilter: An internal error occurred while trying to authenticate the user. org.springframework.security.authentication.InternalAuthenticationServiceException: Failed to parse DN; nested exception is org.springframework.ldap.core.TokenMgrError: Lexical error at line 1, column 4. Encountered: "(" (40), after : ""
Cause
​This issue is because the "User DN pattern" configured is wrong. So, while logging, apart from username and password we will authenticate the DN pattern is configured. As this was configured wrongly, authentication was failing.
Solution
​To resolve this issue, either configure the correct DN pattern to login or do not configure the DN pattern as ​it is not a mandatory field.

​Refer to the below screenshot:

tempsnip123.png 
 
 
More Information
​The full error stack is as below:

[ERROR] UsernamePasswordAuthenticationFilter: An internal error occurred while trying to authenticate the user.

org.springframework.security.authentication.InternalAuthenticationServiceException: Failed to parse DN; nested exception is org.springframework.ldap.core.TokenMgrError: Lexical error at line 1, column 4.  Encountered: "(" (40), after : ""

        at org.springframework.security.ldap.authentication.LdapAuthenticationProvider.doAuthentication(LdapAuthenticationProvider.java:191)

        at org.springframework.security.ldap.authentication.AbstractLdapAuthenticationProvider.authenticate(AbstractLdapAuthenticationProvider.java:61)

        at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:156)

        at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:174)

        at org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter.attemptAuthentication(UsernamePasswordAuthenticationFilter.java:94)

        at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:195)

        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

        at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)

        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)

        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

        at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)

        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)

        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)

        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

        at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:149)

        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)

        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)

        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)

        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)

        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)

        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)

        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)

        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)

        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)

        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)

        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

        at java.lang.Thread.run(Thread.java:745)

Caused by: org.springframework.ldap.BadLdapGrammarException: Failed to parse DN; nested exception is org.springframework.ldap.core.TokenMgrError: Lexical error at line 1, column 4.  Encountered: "(" (40), after : ""

        at org.springframework.ldap.core.DistinguishedName.parse(DistinguishedName.java:224)

        at org.springframework.ldap.core.DistinguishedName.<init>(DistinguishedName.java:174)

        at org.springframework.security.ldap.authentication.BindAuthenticator.bindWithDn(BindAuthenticator.java:104)

        at org.springframework.security.ldap.authentication.BindAuthenticator.authenticate(BindAuthenticator.java:81)

        at com.informatica.cep.design.application.security.ldap.DTBindAuthenticator.authenticate(DTBindAuthenticator.java:155)

        at org.springframework.security.ldap.authentication.LdapAuthenticationProvider.doAuthentication(LdapAuthenticationProvider.java:178)

        ... 38 more

Caused by: org.springframework.ldap.core.TokenMgrError: Lexical error at line 1, column 4.  Encountered: "(" (40), after : ""

        at org.springframework.ldap.core.DnParserImplTokenManager.getNextToken(DnParserImplTokenManager.java:678)

        at org.springframework.ldap.core.DnParserImpl.jj_consume_token(DnParserImpl.java:231)

        at org.springframework.ldap.core.DnParserImpl.SpacedEquals(DnParserImpl.java:114)

        at org.springframework.ldap.core.DnParserImpl.attributeTypeAndValue(DnParserImpl.java:94)

        at org.springframework.ldap.core.DnParserImpl.rdn(DnParserImpl.java:58)

        at org.springframework.ldap.core.DnParserImpl.dn(DnParserImpl.java:23)

        at org.springframework.ldap.core.DistinguishedName.parse(DistinguishedName.java:218)

        ... 43 more

Applies To
Product: Complex Event Processing
Problem Type: Configuration
User Type: Administrator
Project Phase: Configure
Product Version:
Database:
Operating System:
Other Software:

Reference
Attachments
Last Modified Date:3/10/2020 1:33 AMID:604902
People who viewed this also viewed

Feedback

Did this KB document help you?



What can we do to improve this information (2000 or fewer characters)