Package org.keycloak.services
Class DefaultKeycloakContext
java.lang.Object
org.keycloak.services.DefaultKeycloakContext
- All Implemented Interfaces:
KeycloakContext
- Author:
- Stian Thorgersen
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected ClientConnection
protected abstract HttpRequest
protected abstract HttpResponse
Get current AuthenticationSessionModel, can be null out of the AuthenticationSession context.getRealm()
jakarta.ws.rs.core.HttpHeaders
Deprecated.protected KeycloakSession
getUri()
Returns the URI assuming it is a frontend request.Returns the URI.resolveLocale
(UserModel user) void
setAuthenticationSession
(AuthenticationSessionModel authenticationSession) void
setClient
(ClientModel client) void
setConnection
(ClientConnection clientConnection) void
setHttpRequest
(HttpRequest httpRequest) void
setHttpResponse
(HttpResponse httpResponse) void
setRealm
(RealmModel realm) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.keycloak.models.KeycloakContext
getContextObject
-
Field Details
-
session
-
-
Constructor Details
-
DefaultKeycloakContext
-
-
Method Details
-
getAuthServerUrl
- Specified by:
getAuthServerUrl
in interfaceKeycloakContext
-
getContextPath
- Specified by:
getContextPath
in interfaceKeycloakContext
-
getUri
Description copied from interface:KeycloakContext
Returns the URI. If a frontend request (from user-agent) @frontendRequest should be set to true. If a backend request (request from a client) should be set to false. Depending on the configure hostname provider it may return a hard-coded base URL for frontend request (for example https://auth.mycompany.com) and use the request URL for backend requests. Frontend URI should also be used for realm issuer fields in tokens.- Specified by:
getUri
in interfaceKeycloakContext
- Parameters:
type
- the type of the request- Returns:
-
getUri
Description copied from interface:KeycloakContext
Returns the URI assuming it is a frontend request. To resolve URI for a backend request useKeycloakContext.getUri(UrlType)
- Specified by:
getUri
in interfaceKeycloakContext
- Returns:
-
getRequestHeaders
Deprecated.UsegetHttpRequest()
to obtain the request headers.- Specified by:
getRequestHeaders
in interfaceKeycloakContext
- Returns:
-
getRealm
- Specified by:
getRealm
in interfaceKeycloakContext
-
setRealm
- Specified by:
setRealm
in interfaceKeycloakContext
-
getClient
- Specified by:
getClient
in interfaceKeycloakContext
-
setClient
- Specified by:
setClient
in interfaceKeycloakContext
-
getConnection
- Specified by:
getConnection
in interfaceKeycloakContext
-
resolveLocale
- Specified by:
resolveLocale
in interfaceKeycloakContext
-
getAuthenticationSession
Description copied from interface:KeycloakContext
Get current AuthenticationSessionModel, can be null out of the AuthenticationSession context.- Specified by:
getAuthenticationSession
in interfaceKeycloakContext
- Returns:
- current AuthenticationSessionModel or null
-
setAuthenticationSession
- Specified by:
setAuthenticationSession
in interfaceKeycloakContext
-
getHttpRequest
- Specified by:
getHttpRequest
in interfaceKeycloakContext
-
getHttpResponse
- Specified by:
getHttpResponse
in interfaceKeycloakContext
-
createClientConnection
-
createHttpRequest
-
createHttpResponse
-
getSession
-
setConnection
- Specified by:
setConnection
in interfaceKeycloakContext
-
setHttpRequest
- Specified by:
setHttpRequest
in interfaceKeycloakContext
-
setHttpResponse
- Specified by:
setHttpResponse
in interfaceKeycloakContext
-
getHttpRequest()
to obtain the request headers.