private Optional<AuthenticationMethod> getAuthenticatedUserLocalAuthenticationMethod() {
    User authenticatedUser = getUser(AuthorizationHelper.getAuthenticatedId());
    return authenticatedUser.getAuthenticationMethods().stream()
      .filter(am -> UserAuthenticationType.LOCAL.equals(am.getAuthenticationType()))
      .findAny();
  }
Modifies authentication key of an authentication source for a user

@throws AmbariException
ambari-server/src/main/java/org/apache/ambari/server/security/authorization/Users.java