[java-identity-provider COMMIT] in /trunk/idp-authn-impl: pom.xml src/main/java/net/shibboleth/idp/authn/impl/Validat...

noreply at shibboleth.net noreply at shibboleth.net
Mon Aug 5 14:08:10 EDT 2013


Author: scantor
Date: Mon Aug  5 14:08:10 2013
New Revision: 4656

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4656&view=rev
Log:
Add LDAP test for JAAS action.

Added:
    trunk/idp-authn-impl/src/test/resources/net/
    trunk/idp-authn-impl/src/test/resources/net/shibboleth/
    trunk/idp-authn-impl/src/test/resources/net/shibboleth/idp/
    trunk/idp-authn-impl/src/test/resources/net/shibboleth/idp/authn/
    trunk/idp-authn-impl/src/test/resources/net/shibboleth/idp/authn/impl/
    trunk/idp-authn-impl/src/test/resources/net/shibboleth/idp/authn/impl/jaas.config
    trunk/idp-authn-impl/src/test/resources/net/shibboleth/idp/authn/impl/loginLDAPTest.ldif
Modified:
    trunk/idp-authn-impl/pom.xml
    trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateUsernamePasswordAgainstJAAS.java
    trunk/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateUsernamePasswordAgainstJAASTest.java

Modified: trunk/idp-authn-impl/pom.xml
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-impl/pom.xml?rev=4656&r1=4655&r2=4656&view=diff
==============================================================================
--- trunk/idp-authn-impl/pom.xml (original)
+++ trunk/idp-authn-impl/pom.xml Mon Aug  5 14:08:10 2013
@@ -57,6 +57,18 @@
             <version>${opensaml.version}</version>
             <scope>test</scope>
         </dependency>
+
+        <dependency>
+            <groupId>com.unboundid</groupId>
+            <artifactId>unboundid-ldapsdk</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ldaptive</groupId>
+            <artifactId>ldaptive</artifactId>
+            <scope>test</scope>
+        </dependency>
         
     </dependencies>
     

Modified: trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateUsernamePasswordAgainstJAAS.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateUsernamePasswordAgainstJAAS.java?rev=4656&r1=4655&r2=4656&view=diff
==============================================================================
--- trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateUsernamePasswordAgainstJAAS.java (original)
+++ trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateUsernamePasswordAgainstJAAS.java Mon Aug  5 14:08:10 2013
@@ -203,8 +203,8 @@
         javax.security.auth.login.LoginContext jaasLoginCtx;
         
         if (getLoginConfigType() != null) {
-            log.debug("{} using custom JAAS configuration type {} with parameters: {}", getLogPrefix(),
-                    getLoginConfigType(), getLoginConfigParameters());
+            log.debug("{} using custom JAAS configuration type {} with parameters of type {}", getLogPrefix(),
+                    getLoginConfigType(), getLoginConfigParameters().getClass().getName());
             Configuration loginConfig = Configuration.getInstance(getLoginConfigType(), getLoginConfigParameters());
             jaasLoginCtx = new javax.security.auth.login.LoginContext(getLoginConfigName(), subject,
                     new SimpleCallbackHandler(), loginConfig);

Modified: trunk/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateUsernamePasswordAgainstJAASTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateUsernamePasswordAgainstJAASTest.java?rev=4656&r1=4655&r2=4656&view=diff
==============================================================================
--- trunk/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateUsernamePasswordAgainstJAASTest.java (original)
+++ trunk/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/ValidateUsernamePasswordAgainstJAASTest.java Mon Aug  5 14:08:10 2013
@@ -18,9 +18,15 @@
 package net.shibboleth.idp.authn.impl;
 
 
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.security.URIParameter;
+
 import javax.security.auth.login.LoginException;
 
 import net.shibboleth.idp.authn.AuthnEventIds;
+import net.shibboleth.idp.authn.UsernamePrincipal;
 import net.shibboleth.idp.authn.context.AuthenticationContext;
 import net.shibboleth.idp.authn.context.UsernamePasswordContext;
 
@@ -28,13 +34,44 @@
 import org.opensaml.profile.context.ProfileRequestContext;
 import org.springframework.mock.web.MockHttpServletRequest;
 import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
+
+import com.unboundid.ldap.listener.InMemoryDirectoryServer;
+import com.unboundid.ldap.listener.InMemoryDirectoryServerConfig;
+import com.unboundid.ldap.listener.InMemoryListenerConfig;
+import com.unboundid.ldap.sdk.LDAPException;
 
 /** {@link ValidateUsernamePasswordAgainstJAAS} unit test. */

[... 78 lines stripped ...]


More information about the commits mailing list