Samples JDK
SampleUsernameTokenValidator.java
1 package com.freemindcafe.apache.cxf.wsdl.sample3;
2 
3 import org.apache.wss4j.common.ext.WSSecurityException;
4 import org.apache.wss4j.dom.handler.RequestData;
5 import org.apache.wss4j.dom.message.token.UsernameToken;
6 import org.apache.wss4j.dom.validate.Credential;
7 import org.apache.wss4j.dom.validate.UsernameTokenValidator;
8 
9 public class SampleUsernameTokenValidator extends UsernameTokenValidator {
10 
11  public Credential validate( Credential credential, RequestData request ) throws WSSecurityException {
12  UsernameToken userToken = credential.getUsernametoken();
13  final String userId = userToken.getName();
14  final String password = userToken.getPassword();
15  System.out.println("EmeterUsernameTokenValidator-----------------");
16  System.out.println("usernname - " + userId);
17  System.out.println("password - " + password);
18  return credential;
19  }
20 }