Bug 353465 - JAASLoginService ignores callbackHandlerClass

This commit is contained in:
Jan Bartel 2011-08-01 12:55:32 +10:00
parent f7cc402219
commit 56866b3e68
2 changed files with 40 additions and 16 deletions

View File

@ -11,6 +11,7 @@ jetty-7.5.0-SNAPSHOT
+ 353095 maven-jetty-plugin: PermGen leak due to javax.el.BeanELResolver + 353095 maven-jetty-plugin: PermGen leak due to javax.el.BeanELResolver
+ 353165 addJars can follow symbolic link jar files + 353165 addJars can follow symbolic link jar files
+ 353210 Bundle-Version in o.e.j.o.boot.logback fix + 353210 Bundle-Version in o.e.j.o.boot.logback fix
+ 353465 JAASLoginService ignores callbackHandlerClass
jetty-7.4.4.v20110707 July 7th 2011 jetty-7.4.4.v20110707 July 7th 2011
+ 308851 Converted all jetty-client module tests to JUnit 4 + 308851 Converted all jetty-client module tests to JUnit 4

View File

@ -35,6 +35,7 @@ import org.eclipse.jetty.security.DefaultIdentityService;
import org.eclipse.jetty.security.IdentityService; import org.eclipse.jetty.security.IdentityService;
import org.eclipse.jetty.security.LoginService; import org.eclipse.jetty.security.LoginService;
import org.eclipse.jetty.server.UserIdentity; import org.eclipse.jetty.server.UserIdentity;
import org.eclipse.jetty.util.Loader;
import org.eclipse.jetty.util.component.AbstractLifeCycle; import org.eclipse.jetty.util.component.AbstractLifeCycle;
import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Log;
@ -173,9 +174,13 @@ public class JAASLoginService extends AbstractLifeCycle implements LoginService
{ {
try try
{ {
CallbackHandler callbackHandler = new CallbackHandler() CallbackHandler callbackHandler = null;
{
if (_callbackHandlerClass == null)
{
callbackHandler = new CallbackHandler()
{
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
{ {
for (Callback callback: callbacks) for (Callback callback: callbacks)
@ -195,6 +200,12 @@ public class JAASLoginService extends AbstractLifeCycle implements LoginService
} }
} }
}; };
}
else
{
Class clazz = Loader.loadClass(getClass(), _callbackHandlerClass);
callbackHandler = (CallbackHandler)clazz.newInstance();
}
//set up the login context //set up the login context
//TODO jaspi requires we provide the Configuration parameter //TODO jaspi requires we provide the Configuration parameter
Subject subject = new Subject(); Subject subject = new Subject();
@ -220,6 +231,18 @@ public class JAASLoginService extends AbstractLifeCycle implements LoginService
{ {
Log.warn(e); Log.warn(e);
} }
catch (InstantiationException e)
{
Log.warn(e);
}
catch (IllegalAccessException e)
{
Log.warn(e);
}
catch (ClassNotFoundException e)
{
Log.warn(e);
}
return null; return null;
} }