Search in sources :

Example 1 with NameDigestPasswordCallbackHandler

use of org.apache.cxf.interceptor.security.NameDigestPasswordCallbackHandler 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());
}
Also used : SecurityToken(org.apache.cxf.common.security.SecurityToken) NameDigestPasswordCallbackHandler(org.apache.cxf.interceptor.security.NameDigestPasswordCallbackHandler) NamePasswordCallbackHandler(org.apache.cxf.interceptor.security.NamePasswordCallbackHandler) UsernameToken(org.apache.cxf.common.security.UsernameToken)

Aggregations

SecurityToken (org.apache.cxf.common.security.SecurityToken)1 UsernameToken (org.apache.cxf.common.security.UsernameToken)1 NameDigestPasswordCallbackHandler (org.apache.cxf.interceptor.security.NameDigestPasswordCallbackHandler)1 NamePasswordCallbackHandler (org.apache.cxf.interceptor.security.NamePasswordCallbackHandler)1