/** * Returns the <code>UsernameToken</code> element. * * The method can be called any time after <code>prepare()</code>. * This allows to insert the UsernameToken element at any position in the * Security header. * * @return the Username Token element */ public Element getUsernameTokenElement() { return ut.getElement(); }
/** * Appends the UsernameToken element to the elements already in the * Security header. * * The method can be called any time after <code>prepare()</code>. * This allows to insert the UsernameToken element at any position in the * Security header. */ public void appendToHeader() { Element securityHeaderElement = getSecurityHeader().getSecurityHeaderElement(); securityHeaderElement.appendChild(ut.getElement()); }
/** * Prepends the UsernameToken element to the elements already in the * Security header. * * The method can be called any time after <code>prepare()</code>. * This allows to insert the UsernameToken element at any position in the * Security header. */ public void prependToHeader() { Element securityHeaderElement = getSecurityHeader().getSecurityHeaderElement(); WSSecurityUtil.prependChildElement(securityHeaderElement, ut.getElement()); }
public WSSecurityEngineResult(int act, UsernameToken usernameToken, Principal principal) { put(TAG_ACTION, act); put(TAG_USERNAME_TOKEN, usernameToken); put(TAG_PRINCIPAL, principal); put(TAG_VALIDATED_TOKEN, Boolean.FALSE); put(TAG_TOKEN_ELEMENT, usernameToken.getElement()); }
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { for (int i = 0; i < callbacks.length; i++) { if (callbacks[i] instanceof DelegationCallback) { DelegationCallback callback = (DelegationCallback) callbacks[i]; Message message = callback.getCurrentMessage(); String username = (String)SecurityUtils.getSecurityPropertyValue(SecurityConstants.USERNAME, message); if (username != null) { Node contentNode = message.getContent(Node.class); Document doc = null; if (contentNode != null) { doc = contentNode.getOwnerDocument(); } else { doc = DOMUtils.getEmptyDocument(); } UsernameToken usernameToken = createWSSEUsernameToken(username, doc); callback.setToken(usernameToken.getElement()); } } else { throw new UnsupportedCallbackException(callbacks[i], "Unrecognized Callback"); } } }
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { for (int i = 0; i < callbacks.length; i++) { if (callbacks[i] instanceof DelegationCallback) { DelegationCallback callback = (DelegationCallback) callbacks[i]; Message message = callback.getCurrentMessage(); String username = (String)SecurityUtils.getSecurityPropertyValue(SecurityConstants.USERNAME, message); if (username != null) { Node contentNode = message.getContent(Node.class); Document doc = null; if (contentNode != null) { doc = contentNode.getOwnerDocument(); } else { doc = DOMUtils.getEmptyDocument(); } UsernameToken usernameToken = createWSSEUsernameToken(username, doc); callback.setToken(usernameToken.getElement()); } } else { throw new UnsupportedCallbackException(callbacks[i], "Unrecognized Callback"); } } }
private Element convertToDOM( String username, String password, String passwordType, String id ) { Document doc = DOMUtils.getEmptyDocument(); UsernameToken usernameToken = new UsernameToken(true, doc, passwordType); usernameToken.setName(username); usernameToken.setPassword(password); usernameToken.setID(id); usernameToken.addWSSENamespace(); usernameToken.addWSUNamespace(); return usernameToken.getElement(); }
private Element convertToDOM( String username, String password, String passwordType, String id ) { Document doc = DOMUtils.getEmptyDocument(); UsernameToken usernameToken = new UsernameToken(true, doc, passwordType); usernameToken.setName(username); usernameToken.setPassword(password); usernameToken.setID(id); usernameToken.addWSSENamespace(); usernameToken.addWSUNamespace(); return usernameToken.getElement(); }
response.setToken(ut.getElement()); response.setTokenId(ut.getID());
secToken.setToken(ut.getElement()); int hashCode = ut.hashCode(); String identifier = Integer.toString(hashCode);
secToken.setToken(ut.getElement()); int hashCode = ut.hashCode(); String identifier = Integer.toString(hashCode);
tokenElement = credential.getUsernametoken().getElement(); hash = credential.getUsernametoken().hashCode(); } else if (credential.getBinarySecurityToken() != null) {
tokenElement = credential.getUsernametoken().getElement(); hash = credential.getUsernametoken().hashCode(); } else if (credential.getBinarySecurityToken() != null) {