Package org.keycloak.services.util
Class DefaultClientSessionContext
java.lang.Object
org.keycloak.services.util.DefaultClientSessionContext
- All Implemented Interfaces:
ClientSessionContext
Not thread safe. It's per-request object
- Author:
- Marek Posolda
-
Method Summary
Modifier and TypeMethodDescriptionstatic DefaultClientSessionContext
fromClientSessionAndClientScopes
(AuthenticatedClientSessionModel clientSession, Set<ClientScopeModel> requestedScopes, KeycloakSession session) static DefaultClientSessionContext
fromClientSessionAndScopeParameter
(AuthenticatedClientSessionModel clientSession, String scopeParam, KeycloakSession session) static DefaultClientSessionContext
fromClientSessionScopeParameter
(AuthenticatedClientSessionModel clientSession, KeycloakSession session) Useful if we want to "re-compute" client scopes based on the scope parameter<T> T
getAttribute
(String name, Class<T> clazz) Returns client scopes as a stream.Returns protocol mappers as a stream.Returns all roles including composite ones as a stream.getScopeString
(boolean ignoreIncludeInTokenScope) void
setAttribute
(String name, Object value)
-
Method Details
-
fromClientSessionScopeParameter
public static DefaultClientSessionContext fromClientSessionScopeParameter(AuthenticatedClientSessionModel clientSession, KeycloakSession session) Useful if we want to "re-compute" client scopes based on the scope parameter -
fromClientSessionAndScopeParameter
public static DefaultClientSessionContext fromClientSessionAndScopeParameter(AuthenticatedClientSessionModel clientSession, String scopeParam, KeycloakSession session) -
fromClientSessionAndClientScopes
public static DefaultClientSessionContext fromClientSessionAndClientScopes(AuthenticatedClientSessionModel clientSession, Set<ClientScopeModel> requestedScopes, KeycloakSession session) -
getClientSession
- Specified by:
getClientSession
in interfaceClientSessionContext
-
getClientScopeIds
- Specified by:
getClientScopeIds
in interfaceClientSessionContext
-
getClientScopesStream
Description copied from interface:ClientSessionContext
Returns client scopes as a stream.- Specified by:
getClientScopesStream
in interfaceClientSessionContext
- Returns:
- Stream of client scopes. Never returns
null
.
-
getRolesStream
Description copied from interface:ClientSessionContext
Returns all roles including composite ones as a stream.- Specified by:
getRolesStream
in interfaceClientSessionContext
- Returns:
- Stream of
RoleModel
. Never returnsnull
.
-
getProtocolMappersStream
Description copied from interface:ClientSessionContext
Returns protocol mappers as a stream.- Specified by:
getProtocolMappersStream
in interfaceClientSessionContext
- Returns:
- Stream of protocol mappers. Never returns
null
.
-
getScopeString
- Specified by:
getScopeString
in interfaceClientSessionContext
-
getScopeString
- Specified by:
getScopeString
in interfaceClientSessionContext
-
setAttribute
- Specified by:
setAttribute
in interfaceClientSessionContext
-
getAttribute
- Specified by:
getAttribute
in interfaceClientSessionContext
-
getAuthorizationRequestContext
- Specified by:
getAuthorizationRequestContext
in interfaceClientSessionContext
-