use of org.apache.cxf.interceptor.security.callback.CertKeyToUserNameMapper in project cxf by apache.
the class JAASLoginInterceptorTest method testLoginWithTlsHandler.
@Test
public void testLoginWithTlsHandler() {
JAASLoginInterceptor jaasInt = createTestJaasLoginInterceptor();
CallbackHandlerTlsCert tlsHandler = new CallbackHandlerTlsCert();
tlsHandler.setFixedPassword(TestUserPasswordLoginModule.TESTPASS);
CertKeyToUserNameMapper certMapper = new CertKeyToUserNameMapper();
certMapper.setKey("CN");
tlsHandler.setCertMapper(certMapper);
jaasInt.setCallbackHandlerProviders(Collections.singletonList((CallbackHandlerProvider) tlsHandler));
Message message = new MessageImpl();
TLSSessionInfo sessionInfo = new TLSSessionInfo("", null, new Certificate[] { createTestCert(TEST_SUBJECT_DN) });
message.put(TLSSessionInfo.class, sessionInfo);
jaasInt.handleMessage(message);
}
Aggregations