diff --git a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationService.java b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationService.java index 93cf77454ffee..620dee3fb159a 100644 --- a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationService.java +++ b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationService.java @@ -85,19 +85,6 @@ public AuthenticationService(ServiceConfiguration conf) throws PulsarServerExcep } } - public String authenticate(AuthenticationDataSource authData, String authMethodName) - throws AuthenticationException { - AuthenticationProvider provider = providers.get(authMethodName); - if (provider != null) { - return provider.authenticate(authData); - } else { - if (StringUtils.isNotBlank(anonymousUserRole)) { - return anonymousUserRole; - } - throw new AuthenticationException("Unsupported authentication mode: " + authMethodName); - } - } - public String authenticateHttpRequest(HttpServletRequest request) throws AuthenticationException { AuthenticationException authenticationException = null; AuthenticationDataSource authData = new AuthenticationDataHttps(request); diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/auth/AuthenticationServiceTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/auth/AuthenticationServiceTest.java index ae9116aced7a3..15feac95380a6 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/auth/AuthenticationServiceTest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/auth/AuthenticationServiceTest.java @@ -41,18 +41,6 @@ public class AuthenticationServiceTest { private static final String s_authentication_success = "authenticated"; - @Test(timeOut = 10000) - public void testAuthentication() throws Exception { - ServiceConfiguration config = new ServiceConfiguration(); - Set providersClassNames = Sets.newHashSet(MockAuthenticationProvider.class.getName()); - config.setAuthenticationProviders(providersClassNames); - config.setAuthenticationEnabled(true); - AuthenticationService service = new AuthenticationService(config); - String result = service.authenticate(null, "auth"); - assertEquals(result, s_authentication_success); - service.close(); - } - @Test(timeOut = 10000) public void testAuthenticationHttp() throws Exception { ServiceConfiguration config = new ServiceConfiguration();