public class KeycloakAuthenticationEntryPoint extends Object implements org.springframework.security.web.AuthenticationEntryPoint
authentication entry point
. Uses a
RequestMatcher
to determine if the request is an interactive login request or a
API request, which should not be redirected to an interactive login page. By default,
this entry point uses a HttpHeaderInspectingApiRequestMatcher
but can be overridden using in the
constructor.HttpHeaderInspectingApiRequestMatcher
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_LOGIN_URI
Default Keycloak authentication login URI
|
Constructor and Description |
---|
KeycloakAuthenticationEntryPoint()
Creates a new Keycloak authentication entry point.
|
KeycloakAuthenticationEntryPoint(org.springframework.security.web.util.matcher.RequestMatcher apiRequestMatcher)
Creates a new Keycloak authentication entry point using the given request
matcher to determine if the current request is an API request or a browser request.
|
Modifier and Type | Method and Description |
---|---|
void |
commence(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.security.core.AuthenticationException authException) |
protected void |
commenceLoginRedirect(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected void |
commenceUnauthorizedResponse(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
void |
setLoginUri(String loginUri) |
void |
setRealm(String realm) |
public static final String DEFAULT_LOGIN_URI
public KeycloakAuthenticationEntryPoint()
public KeycloakAuthenticationEntryPoint(org.springframework.security.web.util.matcher.RequestMatcher apiRequestMatcher)
apiRequestMatcher
- the RequestMatcher
to use to determine
if the current request is an API request or a browser request (required)public void commence(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException authException) throws IOException, javax.servlet.ServletException
commence
in interface org.springframework.security.web.AuthenticationEntryPoint
IOException
javax.servlet.ServletException
protected void commenceLoginRedirect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
IOException
protected void commenceUnauthorizedResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
IOException
public void setLoginUri(String loginUri)
public void setRealm(String realm)
Copyright © 2016 JBoss by Red Hat. All rights reserved.