Announcement Announcement Module
Collapse
No announcement yet.
Spring security Open ldap issue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring security Open ldap issue

    Hi,
    I am using Openldap,spring security 3.0.5,cas-server-support-ldap-3.4.8.jar. I am trying to do cas server authentication against open ldap. Once I get the DirContext object, I am trying to get PasswordPolicyResponseControl object using the following code.

    for (final String dn : cns) {
    String finalDn = //calling a method to get finalDn;
    try {
    this.log.debug("Performing LDAP bind with credential: " + dn);
    DirContext test = this.getContextSource().getContext(
    finalDn,
    credentials.getPassword());
    log.info("BindLdapAuthenticationHandler test:");
    if (test != null) {
    PasswordPolicyResponseControl pPolicyRespCtrl = PasswordPolicyControlExtractor.extractControl(test );
    log.info("BindLdapAuthenticationHandler checking expired: "+pPolicyRespCtrl.isExpired());
    log.info("BindLdapAuthenticationHandler checking locked: "+pPolicyRespCtrl.isLocked());
    return true;
    }
    } catch (final Exception e) {
    // if we catch an exception, just try the next cn
    } finally {
    LdapUtils.closeContext(test);
    }
    }



    But I am getting the following exception at the line
    PasswordPolicyResponseControl pPolicyRespCtrl = PasswordPolicyControlExtractor.extractControl(test );

    java.lang.IllegalArgumentException: resourceOperatedUpon cannot be null
    at com.github.inspektr.audit.AuditActionContext.asser tNotNull(AuditActionContext.java:81)
    at com.github.inspektr.audit.AuditActionContext.<init >(AuditActionContext.java:64)
    at com.github.inspektr.audit.AuditTrailManagementAspe ct.executeAuditCode(AuditTrailManagementAspect.jav a:148)
    at com.github.inspektr.audit.AuditTrailManagementAspe ct.handleAuditTrail(AuditTrailManagementAspect.jav a:139)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.aop.aspectj.AbstractAspectJAdv ice.invokeAdviceMethodWithGivenArgs(AbstractAspect JAdvice.java:621)
    at org.springframework.aop.aspectj.AbstractAspectJAdv ice.invokeAdviceMethod(AbstractAspectJAdvice.java: 610)
    at org.springframework.aop.aspectj.AspectJAroundAdvic e.invoke(AspectJAroundAdvice.java:65)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :161)
    at org.springframework.aop.interceptor.ExposeInvocati onInterceptor.invoke(ExposeInvocationInterceptor.j ava:89)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:202)
    at $Proxy24.createTicketGrantingTicket(Unknown Source)
    at org.jasig.cas.web.flow.AuthenticationViaFormAction .submit_aroundBody2(AuthenticationViaFormAction.ja va:85)
    at org.jasig.cas.web.flow.AuthenticationViaFormAction .submit_aroundBody3$advice(AuthenticationViaFormAc tion.java:44)
    at org.jasig.cas.web.flow.AuthenticationViaFormAction .submit(AuthenticationViaFormAction.java:1)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:830 )
    at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime .java:1253)
    at ognl.ObjectMethodAccessor.callMethod(ObjectMethodA ccessor.java:68)
    at ognl.OgnlRuntime.callMethod(OgnlRuntime.java:1329)
    at ognl.ASTMethod.getValueBody(ASTMethod.java:90)
    at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.ja va:212)
    at ognl.SimpleNode.getValue(SimpleNode.java:258)
    at ognl.ASTChain.getValueBody(ASTChain.java:141)
    at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.ja va:212)
    at ognl.SimpleNode.getValue(SimpleNode.java:258)
    at ognl.Ognl.getValue(Ognl.java:494)

    Any idea what I am doing wrong here. Cas server I am using is cas-server-3.4.8

    Thanks in advance,
    Vinu
Working...
X