Package org.keycloak.services.util
Class DefaultClientSessionContext
- java.lang.Object
-
- org.keycloak.services.util.DefaultClientSessionContext
-
- All Implemented Interfaces:
ClientSessionContext
public class DefaultClientSessionContext extends Object implements ClientSessionContext
Not thread safe. It's per-request object- Author:
- Marek Posolda
-
-
Method Summary
-
-
-
Method Detail
-
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)
-
fromClientSessionAndClientScopeIds
public static DefaultClientSessionContext fromClientSessionAndClientScopeIds(AuthenticatedClientSessionModel clientSession, Set<String> clientScopeIds, KeycloakSession session)
-
getClientSession
public AuthenticatedClientSessionModel getClientSession()
- Specified by:
getClientSession
in interfaceClientSessionContext
-
getClientScopeIds
public Set<String> getClientScopeIds()
- Specified by:
getClientScopeIds
in interfaceClientSessionContext
-
getClientScopesStream
public Stream<ClientScopeModel> 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
public Stream<RoleModel> 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
public Stream<ProtocolMapperModel> 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
public String getScopeString()
- Specified by:
getScopeString
in interfaceClientSessionContext
-
setAttribute
public void setAttribute(String name, Object value)
- Specified by:
setAttribute
in interfaceClientSessionContext
-
getAttribute
public <T> T getAttribute(String name, Class<T> clazz)
- Specified by:
getAttribute
in interfaceClientSessionContext
-
getAuthorizationRequestContext
public AuthorizationRequestContext getAuthorizationRequestContext()
- Specified by:
getAuthorizationRequestContext
in interfaceClientSessionContext
-
-