spring mvc - SpringMVC Ldap Authentication @annotated -


i trying use springmvc ldap authentication in app. stuck after response server saying user authenticates successfully.

    11:56:16,289 debug httpsessionsecuritycontextrepository:90 - no securitycontext available httpsession: org.apache.catalina.session.standardsessionfacade@7e18ddb9. new 1 created. 11:56:16,290 debug filterchainproxy:337 - /login @ position 3 of 14 in additional filter chain; firing filter: 'headerwriterfilter' 11:56:16,290 debug hstsheaderwriter:129 - not injecting hsts header since did not match requestmatcher org.springframework.security.web.header.writers.hstsheaderwriter$securerequestmatcher@32326 11:56:16,290 debug filterchainproxy:337 - /login @ position 4 of 14 in additional filter chain; firing filter: 'csrffilter' 11:56:16,291 debug filterchainproxy:337 - /login @ position 5 of 14 in additional filter chain; firing filter: 'logoutfilter' 11:56:16,291 debug antpathrequestmatcher:116 - checking match of request : '/login'; against '/logout' 11:56:16,292 debug filterchainproxy:337 - /login @ position 6 of 14 in additional filter chain; firing filter: 'usernamepasswordauthenticationfilter' 11:56:16,292 debug antpathrequestmatcher:116 - checking match of request : '/login'; against '/login' 11:56:16,292 debug usernamepasswordauthenticationfilter:205 - request process authentication 11:56:16,297 debug providermanager:152 - authentication attempt using org.springframework.security.ldap.authentication.ldapauthenticationprovider 11:56:16,297 debug ldapauthenticationprovider:51 - processing authentication request user: username 11:56:16,299 debug bindauthenticator:108 - attempting bind cn=username,cn=users,dc=myorgnet,dc=global,dc=myorg,dc=com 11:56:16,300 debug defaultspringsecuritycontextsource:76 - removing pooling flag user cn=username,cn=users,dc=myorgnet,dc=global,dc=myorg,dc=com 11:56:16,350 debug abstractcontextsource:259 - got ldap context on server 'ldap://myorgnet.global.myorg.com' 11:56:16,357 debug bindauthenticator:116 - retrieving attributes... 11:56:16,463 debug defaultldapauthoritiespopulator:182 - getting authorities user cn=username,cn=users,dc=myorgnet,dc=global,dc=myorg,dc=com 11:56:16,464 debug defaultldapauthoritiespopulator:211 - searching roles user 'username', dn = 'cn=username,cn=users,dc=myorgnet,dc=global,dc=myorg,dc=com', filter (uniquemember={0}) in search base '' 11:56:16,464 debug springsecurityldaptemplate:152 - using filter: (uniquemember=cn=username,cn=users,dc=myorgnet,dc=global,dc=myorg,dc=com) 11:56:16,468  info ldaptemplate:1262 - returnobjflag of supplied searchcontrols not set contextmapper used - setting flag true 11:56:16,517 debug abstractcontextsource:259 - got ldap context on server 'ldap://myorgnet.global.myorg.com' 11:56:16,542 debug httpsessionsecuritycontextrepository:300 - securitycontext empty or contents anonymous - context not stored in httpsession. 11:56:16,542 debug securitycontextpersistencefilter:97 - securitycontextholder cleared, request processing completed 11:56:16,542 debug securitycontextpersistencefilter:97 - securitycontextholder cleared, request processing completed mar 24, 2014 11:56:16 org.apache.catalina.core.standardwrappervalve invoke severe: servlet.service() servlet [dispatcher] in context path [/results] threw exception org.springframework.ldap.uncategorizedldapexception: uncategorized exception occured during ldap processing; nested exception javax.naming.namingexception: [ldap: error code 1 - 00000000: ldaperr: dsid-0c090627, comment: in order perform operation successful bind must completed on connection., data 0, vece ]; remaining name '' @ org.springframework.ldap.support.ldaputils.convertldapexception(ldaputils.java:217)     @ org.springframework.ldap.core.ldaptemplate.search(ldaptemplate.java:319)     @ org.springframework.ldap.core.ldaptemplate.search(ldaptemplate.java:259)     @ org.springframework.ldap.core.ldaptemplate.search(ldaptemplate.java:606)     @ org.springframework.ldap.core.ldaptemplate.search(ldaptemplate.java:524) 

this have in initializer: public class initializer implements webapplicationinitializer { private static final string dispatcher_servlet_name = "dispatcher";

@override public void onstartup(servletcontext servletcontext)         throws servletexception {     annotationconfigwebapplicationcontext ctx = new annotationconfigwebapplicationcontext();     ctx.register(webappconfig.class);     servletcontext.addlistener(new contextloaderlistener(ctx));      ctx.setservletcontext(servletcontext);      dynamic servlet = servletcontext.addservlet("dispatcher", new dispatcherservlet(ctx));      filterregistration.dynamic springfilter = servletcontext.addfilter("springsecurityfilterchain", delegatingfilterproxy.class);     springfilter.addmappingforurlpatterns(null, true, "/*"); 

my securitycontext looks likes this:

 @configuration  @enablewebsecurity  public class securitycontext extends websecurityconfigureradapter {    @autowired    protected void configureglobal(authenticationmanagerbuilder authmanagerbuilder) {             try{                     contextsourcebuilder ctx = authmanagerbuilder.ldapauthentication()                                 .userdnpatterns("cn={0},cn=users,dc=myorgnet,dc=global,dc=myorg,dc=com")                                             .contextsource().url("ldap://myorgnet.global.myorg.com");                }catch(exception e){      }finally{      } 


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -