Package org.keycloak.models
Interface KeycloakContext
- 
- All Known Implementing Classes:
- DefaultKeycloakContext
 
 public interface KeycloakContext- Author:
- Stian Thorgersen
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description AuthenticationSessionModelgetAuthenticationSession()Get current AuthenticationSessionModel, can be null out of the AuthenticationSession context.URIgetAuthServerUrl()ClientModelgetClient()ClientConnectiongetConnection()<T> TgetContextObject(Class<T> clazz)StringgetContextPath()HttpRequestgetHttpRequest()HttpResponsegetHttpResponse()RealmModelgetRealm()javax.ws.rs.core.HttpHeadersgetRequestHeaders()KeycloakUriInfogetUri()Returns the URI assuming it is a frontend request.KeycloakUriInfogetUri(UrlType type)Returns the URI.LocaleresolveLocale(UserModel user)voidsetAuthenticationSession(AuthenticationSessionModel authenticationSession)voidsetClient(ClientModel client)voidsetRealm(RealmModel realm)
 
- 
- 
- 
Method Detail- 
getAuthServerUrlURI getAuthServerUrl() 
 - 
getContextPathString getContextPath() 
 - 
getUriKeycloakUriInfo getUri() Returns the URI assuming it is a frontend request. To resolve URI for a backend request usegetUri(UrlType)- Returns:
 
 - 
getUriKeycloakUriInfo getUri(UrlType type) 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.- Parameters:
- type- the type of the request
- Returns:
 
 - 
getRequestHeadersjavax.ws.rs.core.HttpHeaders getRequestHeaders() 
 - 
getContextObject<T> T getContextObject(Class<T> clazz) 
 - 
getRealmRealmModel getRealm() 
 - 
setRealmvoid setRealm(RealmModel realm) 
 - 
getClientClientModel getClient() 
 - 
setClientvoid setClient(ClientModel client) 
 - 
getConnectionClientConnection getConnection() 
 - 
getAuthenticationSessionAuthenticationSessionModel getAuthenticationSession() Get current AuthenticationSessionModel, can be null out of the AuthenticationSession context.- Returns:
- current AuthenticationSessionModel or null
 
 - 
setAuthenticationSessionvoid setAuthenticationSession(AuthenticationSessionModel authenticationSession) 
 - 
getHttpRequestHttpRequest getHttpRequest() 
 - 
getHttpResponseHttpResponse getHttpResponse() 
 
- 
 
-