Issue #6554 - DefaultAuthenticatorFactory should not create BasicAuthenticator for null AuthMethod
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
parent
29a8d5d2bd
commit
d35ff03e61
|
@ -62,7 +62,7 @@ public class DefaultAuthenticatorFactory implements Authenticator.Factory
|
||||||
String auth = configuration.getAuthMethod();
|
String auth = configuration.getAuthMethod();
|
||||||
Authenticator authenticator = null;
|
Authenticator authenticator = null;
|
||||||
|
|
||||||
if (auth == null || Constraint.__BASIC_AUTH.equalsIgnoreCase(auth))
|
if (Constraint.__BASIC_AUTH.equalsIgnoreCase(auth))
|
||||||
authenticator = new BasicAuthenticator();
|
authenticator = new BasicAuthenticator();
|
||||||
else if (Constraint.__DIGEST_AUTH.equalsIgnoreCase(auth))
|
else if (Constraint.__DIGEST_AUTH.equalsIgnoreCase(auth))
|
||||||
authenticator = new DigestAuthenticator();
|
authenticator = new DigestAuthenticator();
|
||||||
|
|
|
@ -293,9 +293,6 @@ public abstract class SecurityHandler extends HandlerWrapper implements Authenti
|
||||||
return getServer().getBean(IdentityService.class);
|
return getServer().getBean(IdentityService.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void doStart()
|
protected void doStart()
|
||||||
throws Exception
|
throws Exception
|
||||||
|
@ -349,7 +346,7 @@ public abstract class SecurityHandler extends HandlerWrapper implements Authenti
|
||||||
throw new IllegalStateException("LoginService has different IdentityService to " + this);
|
throw new IllegalStateException("LoginService has different IdentityService to " + this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_authenticator == null && _identityService != null)
|
if (_authenticator == null)
|
||||||
{
|
{
|
||||||
// If someone has set an authenticator factory only use that, otherwise try the list of discovered factories.
|
// If someone has set an authenticator factory only use that, otherwise try the list of discovered factories.
|
||||||
if (_authenticatorFactory != null)
|
if (_authenticatorFactory != null)
|
||||||
|
@ -396,7 +393,6 @@ public abstract class SecurityHandler extends HandlerWrapper implements Authenti
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
||||||
protected void doStop() throws Exception
|
protected void doStop() throws Exception
|
||||||
{
|
{
|
||||||
//if we discovered the services (rather than had them explicitly configured), remove them.
|
//if we discovered the services (rather than had them explicitly configured), remove them.
|
||||||
|
|
Loading…
Reference in New Issue