private Authentication getDefaultAuthentication() {
    Authentication defaultUser = null;

    if ((configuration != null) && (users != null)) {
      String username = configuration.getDefaultApiAuthenticatedUser();

      if (!StringUtils.isEmpty(username)) {
        final User user = users.getUser(username);

        if (user != null) {
          Principal principal = new Principal() {
            @Override
            public String getName() {
              return user.getUserName();
            }
          };

          defaultUser = new UsernamePasswordAuthenticationToken(principal, null,
              users.getUserAuthorities(user.getUserName()));
        }
      }
    }

    return defaultUser;
  }
Creates the default Authentication if a default user is configured

@return an Authentication representing the default user
ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariAuthorizationFilter.java