Пример #1
0
 @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;
 }
Пример #2
0
 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);
   }
 }
Пример #3
0
 public byte[] getUsername() {
   return restUsernameToken.getUsername();
 }