WSSSecurityProperties securityProperties,
boolean included) throws WSSecurityException {
super(wsInboundSecurityContext, id, keyIdentifier, included);
if (securityProperties.getCallbackHandler() != null) {
// Try to get the token from a CallbackHandler
WSPasswordCallback pwcb =
new WSPasswordCallback(id, WSPasswordCallback.CUSTOM_TOKEN);
try {
securityProperties.getCallbackHandler().handle(new Callback[]{pwcb});
} catch (IOException e) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noPassword", e);
} catch (UnsupportedCallbackException e) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noPassword", e);
}
this.tokenElement = pwcb.getCustomToken();
this.key = pwcb.getKey();
}
if (this.tokenElement == null) {
throw new WSSecurityException(
WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "noToken", id