use of org.keycloak.services.resources.admin.info.ServerInfoAdminResource in project keycloak by keycloak.
the class AdminRoot method getServerInfo.
/**
* General information about the server
*
* @param headers
* @return
*/
@Path("serverinfo")
public Object getServerInfo(@Context final HttpHeaders headers) {
if (request.getHttpMethod().equals(HttpMethod.OPTIONS)) {
return new AdminCorsPreflightService(request);
}
AdminAuth auth = authenticateRealmAdminRequest(headers);
if (!AdminPermissions.realms(session, auth).isAdmin()) {
throw new ForbiddenException();
}
if (auth != null) {
logger.debug("authenticated admin access for: " + auth.getUser().getUsername());
}
Cors.add(request).allowedOrigins(auth.getToken()).allowedMethods("GET", "PUT", "POST", "DELETE").auth().build(response);
ServerInfoAdminResource adminResource = new ServerInfoAdminResource();
ResteasyProviderFactory.getInstance().injectProperties(adminResource);
return adminResource;
}
Aggregations