Package io.hawt.web.auth.keycloak
Class KeycloakServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- io.hawt.web.auth.keycloak.KeycloakServlet
-
- All Implemented Interfaces:
Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
public class KeycloakServlet extends javax.servlet.http.HttpServletServlet, 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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringHAWTIO_KEYCLOAK_CLIENT_CONFIGstatic StringKEYCLOAK_CLIENT_CONFIG
-
Constructor Summary
Constructors Constructor Description KeycloakServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringdefaultKeycloakConfigLocation()Will try to guess the config location based on the server where hawtio is running.protected voiddoGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)voidinit()protected booleanvalidateKeycloakUser(javax.servlet.http.HttpServletRequest request, String keycloakUser)-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
-
-
-
-
Field Detail
-
KEYCLOAK_CLIENT_CONFIG
public static final String KEYCLOAK_CLIENT_CONFIG
- See Also:
- Constant Field Values
-
HAWTIO_KEYCLOAK_CLIENT_CONFIG
public static final String HAWTIO_KEYCLOAK_CLIENT_CONFIG
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init()
- Overrides:
initin classjavax.servlet.GenericServlet
-
defaultKeycloakConfigLocation
protected String 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(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException- Overrides:
doGetin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
validateKeycloakUser
protected boolean validateKeycloakUser(javax.servlet.http.HttpServletRequest request, String keycloakUser)
-
-