@Override public boolean equals(Object other) { if (other instanceof UsernameTokenState) { UsernameTokenState otherState = (UsernameTokenState) other; return Arrays.equals(restUsernameToken.getUsername(), otherState.getUsername()) && Arrays.equals(restUsernameToken.getPassword(), otherState.getPassword()); } return false; }
public JsonValue toJson() throws TokenMarshalException { try { return json( object( field(AMSTSConstants.TOKEN_TYPE_KEY, TokenType.USERNAME.name()), field( AMSTSConstants.USERNAME_TOKEN_USERNAME, new String(restUsernameToken.getUsername(), AMSTSConstants.UTF_8_CHARSET_ID)), field( AMSTSConstants.USERNAME_TOKEN_PASSWORD, new String(restUsernameToken.getPassword(), AMSTSConstants.UTF_8_CHARSET_ID)))); } catch (UnsupportedEncodingException e) { throw new TokenMarshalException( ResourceException.BAD_REQUEST, "Unsupported charset marshalling toJson: " + e); } }
public byte[] getPassword() { return restUsernameToken.getPassword(); }
public byte[] getUsername() { return restUsernameToken.getUsername(); }