Issue #6554 - DefaultAuthenticatorFactory should not create BasicAuthenticator for null AuthMethod

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2021-08-02 15:23:28 +10:00
parent 29a8d5d2bd
commit d35ff03e61
2 changed files with 2 additions and 6 deletions

View File

@ -62,7 +62,7 @@ public class DefaultAuthenticatorFactory implements Authenticator.Factory
String auth = configuration.getAuthMethod();
Authenticator authenticator = null;
if (auth == null || Constraint.__BASIC_AUTH.equalsIgnoreCase(auth))
if (Constraint.__BASIC_AUTH.equalsIgnoreCase(auth))
authenticator = new BasicAuthenticator();
else if (Constraint.__DIGEST_AUTH.equalsIgnoreCase(auth))
authenticator = new DigestAuthenticator();

View File

@ -293,9 +293,6 @@ public abstract class SecurityHandler extends HandlerWrapper implements Authenti
return getServer().getBean(IdentityService.class);
}
/**
*
*/
@Override
protected void doStart()
throws Exception
@ -349,7 +346,7 @@ public abstract class SecurityHandler extends HandlerWrapper implements Authenti
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 (_authenticatorFactory != null)
@ -396,7 +393,6 @@ public abstract class SecurityHandler extends HandlerWrapper implements Authenti
}
@Override
protected void doStop() throws Exception
{
//if we discovered the services (rather than had them explicitly configured), remove them.