public void addJWTAuthentication(UserEntity userEntity, String key) throws AmbariException {
    addJWTAuthentication(userEntity, key, true);
  }
Adds the ability for a user to authenticate using a JWT token.
<p>
The key for this authentication mechanism is the username expected to be in the JWT token.
<p>
The created {@link UserAuthenticationEntity} and the supplied {@link UserEntity} are persisted.

@param userEntity the user
@param key        the relevant key
@throws AmbariException
@see #addJWTAuthentication(UserEntity, String, boolean)
ambari-server/src/main/java/org/apache/ambari/server/security/authorization/Users.java