@Override protected Collection<GeoServerRole> getRoles(HttpServletRequest request, String principal) throws IOException { Collection<GeoServerRole> roles; if (PreAuthenticatedUserNameRoleSource.RoleService.equals(getRoleSource())) { roles = getRolesFromRoleService(request, principal); } else if (PreAuthenticatedUserNameRoleSource.UserGroupService.equals(getRoleSource())) { roles = getRolesFromUserGroupService(request, principal); } else if (PreAuthenticatedUserNameRoleSource.Header.equals(getRoleSource())) { roles = getRolesFromHttpAttribute(request, principal); } else { throw new RuntimeException("Never should reach this point"); } LOGGER.log( Level.FINE, "Got roles {0} from {1} for principal {2}", new Object[] {roles, getRoleSource(), principal}); return roles; }