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:
java.io.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 java.lang.StringHAWTIO_KEYCLOAK_CLIENT_CONFIGstatic java.lang.StringKEYCLOAK_CLIENT_CONFIG
-
Constructor Summary
Constructors Constructor Description KeycloakServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.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, java.lang.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 java.lang.String KEYCLOAK_CLIENT_CONFIG
- See Also:
- Constant Field Values
-
HAWTIO_KEYCLOAK_CLIENT_CONFIG
public static final java.lang.String HAWTIO_KEYCLOAK_CLIENT_CONFIG
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init()
- Overrides:
initin classjavax.servlet.GenericServlet
-
defaultKeycloakConfigLocation
protected java.lang.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 java.io.IOException- Overrides:
doGetin classjavax.servlet.http.HttpServlet- Throws:
java.io.IOException
-
validateKeycloakUser
protected boolean validateKeycloakUser(javax.servlet.http.HttpServletRequest request, java.lang.String keycloakUser)
-
-