authProvider.handleAuthentication(cnxn, null)) { LOG.error("Authentication failed for session 0x{}", Long.toHexString(cnxn.getSessionId()));
@Test public void testTrustedAuth() { X509AuthenticationProvider provider = createProvider(clientCert); MockServerCnxn cnxn = new MockServerCnxn(); cnxn.clientChain = new X509Certificate[] { clientCert }; Assert.assertEquals(KeeperException.Code.OK, provider.handleAuthentication(cnxn, null)); }
@Test public void testUntrustedAuth() { X509AuthenticationProvider provider = createProvider(clientCert); MockServerCnxn cnxn = new MockServerCnxn(); cnxn.clientChain = new X509Certificate[] { unknownCert }; Assert.assertEquals(KeeperException.Code.AUTHFAILED, provider.handleAuthentication(cnxn, null)); }
@Test public void testSuperAuth() { X509AuthenticationProvider provider = createProvider(superCert); MockServerCnxn cnxn = new MockServerCnxn(); cnxn.clientChain = new X509Certificate[] { superCert }; Assert.assertEquals(KeeperException.Code.OK, provider.handleAuthentication(cnxn, null)); Assert.assertEquals("super", cnxn.getAuthInfo().get(0).getScheme()); }