use of org.apache.cxf.interceptor.security.NamePasswordCallbackHandler in project cxf by apache.
the class CallbackHandlerTlsCert method create.
@Override
public CallbackHandler create(Message message) {
TLSSessionInfo tlsSession = message.get(TLSSessionInfo.class);
if (tlsSession == null) {
return null;
}
Certificate cert = getCertificate(message);
String name = certMapper.getUserName(cert);
String password = nameToPasswordMapper.getPassword(name);
return new NamePasswordCallbackHandler(name, password);
}
use of org.apache.cxf.interceptor.security.NamePasswordCallbackHandler in project cxf by apache.
the class CallbackHandlerProviderUsernameToken method create.
@Override
public CallbackHandler create(Message message) {
SecurityToken token = message.get(SecurityToken.class);
if (!(token instanceof UsernameToken)) {
return null;
}
UsernameToken ut = (UsernameToken) token;
if (ut.getPasswordType().endsWith("PasswordDigest")) {
return new NameDigestPasswordCallbackHandler(ut.getName(), ut.getPassword(), ut.getNonce(), ut.getCreatedTime());
}
return new NamePasswordCallbackHandler(ut.getName(), ut.getPassword());
}
Aggregations