@ -169,15 +178,20 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
@@ -169,15 +178,20 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
@ -190,6 +204,7 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
@@ -190,6 +204,7 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
@ -202,7 +217,8 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
@@ -202,7 +217,8 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
@ -211,6 +227,7 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
@@ -211,6 +227,7 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
@ -221,8 +238,9 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
@@ -221,8 +238,9 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
@ -249,7 +267,8 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
@@ -249,7 +267,8 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
@ -258,31 +277,36 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
@@ -258,31 +277,36 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
}
publicvoidafterPropertiesSet()throwsException{
Assert.notNull(loginConfig,"loginConfig must be set on "
+getClass());
Assert.hasLength(loginContextName,"loginContextName must be set on "+getClass());
Assert.notNull(loginConfig,"loginConfig must be set on "+getClass());
Assert.hasLength(loginContextName,
"loginContextName must be set on "+getClass());
StringloginConfigStr=null;
try{
loginConfigStr=loginConfig.getFile().toString();
}catch(IOExceptione){
log.debug("Could not resolve loginConfig ["+loginConfig+"] as a File, using URL");
if(log.isDebugEnabled()){
log.debug("Could not resolve loginConfig ["+loginConfig
log.debug("Setting system property ["+SYSPROP+"] to: "+loginConfigStr);
log.debug("Setting system property ["+SYSPROP+"] to: "
+loginConfigStr);
System.setProperty(SYSPROP,loginConfigStr);
}else{
setPropertyUsingLoop(loginConfigStr);
}
Assert.notNull(Configuration.getConfiguration(),
"As per http://java.sun.com/j2se/1.5.0/docs/api/javax/security/auth/login/Configuration.html \"If a Configuration object was set via the Configuration.setConfiguration method, then that object is returned. Otherwise, a default Configuration object is returned\". Your JRE returned null to Configuration.getConfiguration().");
"As per http://java.sun.com/j2se/1.5.0/docs/api/javax/security/auth/login/Configuration.html \"If a Configuration object was set via the Configuration.setConfiguration method, then that object is returned. Otherwise, a default Configuration object is returned\". Your JRE returned null to Configuration.getConfiguration().");
}
/**
@ -290,17 +314,18 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
@@ -290,17 +314,18 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
@ -323,7 +348,7 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
@@ -323,7 +348,7 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
Setprincipals=lc.getSubject().getPrincipals();
for(Iteratoriterator=principals.iterator();
iterator.hasNext();){
iterator.hasNext();){
Principalprincipal=(Principal)iterator.next();
for(inti=0;i<authorityGranters.length;i++){
@ -339,18 +364,19 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
@@ -339,18 +364,19 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
}
//Convert the authorities set back to an array and apply it to the token.
@ -362,6 +388,40 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
@@ -362,6 +388,40 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
@ -381,7 +441,8 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
@@ -381,7 +441,8 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
if(!alreadySet){
Stringkey=prefix+n;
log.debug("Setting security property ["+key+"] to: "+loginConfigStr);
log.debug("Setting security property ["+key+"] to: "
+loginConfigStr);
Security.setProperty(key,loginConfigStr);
}
}
@ -399,7 +460,7 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
@@ -399,7 +460,7 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
@ -199,6 +199,10 @@ public class JaasAuthenticationProviderTests extends TestCase {
@@ -199,6 +199,10 @@ public class JaasAuthenticationProviderTests extends TestCase {