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:
getClientSessionin interfaceClientSessionContext
-
getClientScopeIds
public Set<String> getClientScopeIds()
- Specified by:
getClientScopeIdsin interfaceClientSessionContext
-
getClientScopesStream
public Stream<ClientScopeModel> getClientScopesStream()
Description copied from interface:ClientSessionContextReturns client scopes as a stream.- Specified by:
getClientScopesStreamin interfaceClientSessionContext- Returns:
- Stream of client scopes. Never returns
null.
-
getRolesStream
public Stream<RoleModel> getRolesStream()
Description copied from interface:ClientSessionContextReturns all roles including composite ones as a stream.- Specified by:
getRolesStreamin interfaceClientSessionContext- Returns:
- Stream of
RoleModel. Never returnsnull.
-
getProtocolMappersStream
public Stream<ProtocolMapperModel> getProtocolMappersStream()
Description copied from interface:ClientSessionContextReturns protocol mappers as a stream.- Specified by:
getProtocolMappersStreamin interfaceClientSessionContext- Returns:
- Stream of protocol mappers. Never returns
null.
-
getScopeString
public String getScopeString()
- Specified by:
getScopeStringin interfaceClientSessionContext
-
setAttribute
public void setAttribute(String name, Object value)
- Specified by:
setAttributein interfaceClientSessionContext
-
getAttribute
public <T> T getAttribute(String name, Class<T> clazz)
- Specified by:
getAttributein interfaceClientSessionContext
-
getAuthorizationRequestContext
public AuthorizationRequestContext getAuthorizationRequestContext()
- Specified by:
getAuthorizationRequestContextin interfaceClientSessionContext
-
-