Package io.hawt.web.auth.keycloak
Class KeycloakServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
io.hawt.web.auth.keycloak.KeycloakServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet,jakarta.servlet.ServletConfig,Serializable
public class KeycloakServlet
extends jakarta.servlet.http.HttpServlet
Servlet, which aims to return:
- whether keycloak is enabled (true/false) if path '/enabled' is used
- keycloak.json to be used by keycloak JS adapter on frontend if path '/client-config' is used
- validate if current JAAS logged subject is same like SSO user logged through keycloak
if path '/validate-subject-matches' is used
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringWill try to guess the config location based on the server where hawtio is running.protected voiddoGet(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) voidinit()protected booleanvalidateKeycloakUser(jakarta.servlet.http.HttpServletRequest request, String keycloakUser) Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, serviceMethods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Field Details
-
KEYCLOAK_CLIENT_CONFIG
Keycloak config file used for frontend. Will use default location if not provided.- See Also:
-
HAWTIO_KEYCLOAK_CLIENT_CONFIG
- See Also:
-
-
Constructor Details
-
KeycloakServlet
public KeycloakServlet()
-
-
Method Details
-
init
public void init()- Overrides:
initin classjakarta.servlet.GenericServlet
-
defaultKeycloakConfigLocation
Will try to guess the config location based on the server where hawtio is running. Used just if keycloakClientConfig is not provided- Returns:
- config to be used by default
-
doGet
protected void doGet(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException - Overrides:
doGetin classjakarta.servlet.http.HttpServlet- Throws:
IOException
-
validateKeycloakUser
protected boolean validateKeycloakUser(jakarta.servlet.http.HttpServletRequest request, String keycloakUser)
-