Skip to content

Commit

Permalink
Issue #6554 - DefaultAuthenticatorFactory should not create BasicAuth…
Browse files Browse the repository at this point in the history
…enticator for null AuthMethod

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
  • Loading branch information
lachlan-roberts committed Aug 2, 2021
1 parent 29a8d5d commit d35ff03
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Expand Up @@ -62,7 +62,7 @@ public Authenticator getAuthenticator(Server server, ServletContext context, Aut
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();
Expand Down
Expand Up @@ -293,9 +293,6 @@ protected IdentityService findIdentityService()
return getServer().getBean(IdentityService.class);
}

/**
*
*/
@Override
protected void doStart()
throws Exception
Expand Down Expand Up @@ -349,7 +346,7 @@ else if (_loginService.getIdentityService() != _identityService)
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)
Expand Down Expand Up @@ -396,7 +393,6 @@ else if (_realmName != null)
}

@Override

protected void doStop() throws Exception
{
//if we discovered the services (rather than had them explicitly configured), remove them.
Expand Down

0 comments on commit d35ff03

Please sign in to comment.