Merge branch 'master' of ssh://git.eclipse.org/gitroot/jetty/org.eclipse.jetty.project
This commit is contained in:
commit
0d68272401
|
@ -241,7 +241,10 @@ public class WebBundleDeployerHelper implements IWebBundleDeployerHelper
|
|||
// classes
|
||||
// that the contributor gives access to.
|
||||
Thread.currentThread().setContextClassLoader(composite);
|
||||
|
||||
|
||||
//converts bundleentry: protocol
|
||||
baseWebappInstallURL = DefaultFileLocatorHelper.getLocalURL(baseWebappInstallURL);
|
||||
|
||||
context.setWar(baseWebappInstallURL.toString());
|
||||
context.setContextPath(contextPath);
|
||||
context.setExtraClasspath(extraClasspath);
|
||||
|
|
|
@ -24,6 +24,7 @@ import javax.security.auth.Subject;
|
|||
import javax.security.auth.callback.Callback;
|
||||
import javax.security.auth.callback.CallbackHandler;
|
||||
import javax.security.auth.callback.NameCallback;
|
||||
import javax.security.auth.callback.PasswordCallback;
|
||||
import javax.security.auth.callback.UnsupportedCallbackException;
|
||||
import javax.security.auth.login.LoginException;
|
||||
import javax.security.auth.spi.LoginModule;
|
||||
|
@ -187,9 +188,10 @@ public abstract class AbstractLoginModule implements LoginModule
|
|||
public Callback[] configureCallbacks ()
|
||||
{
|
||||
|
||||
Callback[] callbacks = new Callback[2];
|
||||
Callback[] callbacks = new Callback[3];
|
||||
callbacks[0] = new NameCallback("Enter user name");
|
||||
callbacks[1] = new ObjectCallback();
|
||||
callbacks[2] = new PasswordCallback("Enter password", false); //only used if framework does not support the ObjectCallback
|
||||
return callbacks;
|
||||
}
|
||||
|
||||
|
@ -215,7 +217,11 @@ public abstract class AbstractLoginModule implements LoginModule
|
|||
callbackHandler.handle(callbacks);
|
||||
|
||||
String webUserName = ((NameCallback)callbacks[0]).getName();
|
||||
Object webCredential = ((ObjectCallback)callbacks[1]).getObject();
|
||||
Object webCredential = null;
|
||||
|
||||
webCredential = ((ObjectCallback)callbacks[1]).getObject(); //first check if ObjectCallback has the credential
|
||||
if (webCredential == null)
|
||||
webCredential = ((PasswordCallback)callbacks[2]).getPassword(); //use standard PasswordCallback
|
||||
|
||||
if ((webUserName == null) || (webCredential == null))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue