Package org.keycloak.models.delegate
Class ClientModelLazyDelegate
java.lang.Object
org.keycloak.models.delegate.ClientModelLazyDelegate
- All Implemented Interfaces:
ClientModel
,ClientScopeModel
,OrderedModel
,ProtocolMapperContainerModel
,RoleContainerModel
,ScopeContainerModel
- Direct Known Subclasses:
ClientModelLazyDelegate.WithId
,OIDCClientSecretConfigWrapper.ReadOnlyRotatedSecretClientModel
,TypeAwareClientModelDelegate
- Author:
- hmlnarik
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.keycloak.models.ClientModel
ClientModel.ClientCreationEvent, ClientModel.ClientIdChangeEvent, ClientModel.ClientProtocolUpdatedEvent, ClientModel.ClientRemovedEvent, ClientModel.ClientUpdatedEvent
Nested classes/interfaces inherited from interface org.keycloak.models.ClientScopeModel
ClientScopeModel.ClientScopeCreatedEvent, ClientScopeModel.ClientScopeRemovedEvent
Nested classes/interfaces inherited from interface org.keycloak.models.OrderedModel
OrderedModel.OrderedModelComparator<OM extends OrderedModel>
Nested classes/interfaces inherited from interface org.keycloak.models.RoleContainerModel
RoleContainerModel.RoleRemovedEvent
-
Field Summary
Fields inherited from interface org.keycloak.models.ClientModel
LOGO_URI, POLICY_URI, PRIVATE_KEY, PUBLIC_KEY, TOS_URI, TYPE, X509CERTIFICATE
Fields inherited from interface org.keycloak.models.ClientScopeModel
CONSENT_SCREEN_TEXT, DISPLAY_ON_CONSENT_SCREEN, DYNAMIC_SCOPE_REGEXP, GUI_ORDER, INCLUDE_IN_TOKEN_SCOPE, IS_DYNAMIC_SCOPE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addClientScope
(ClientScopeModel clientScope, boolean defaultScope) Add clientScope with this client.void
addClientScopes
(Set<ClientScopeModel> clientScopes, boolean defaultScope) Add clientScopes with this client.void
addRedirectUri
(String redirectUri) void
addScopeMapping
(RoleModel role) void
addWebOrigin
(String webOrigin) void
deleteScopeMapping
(RoleModel role) getAttribute
(String name) Get authentication flow binding override for this client.Returns client ID as defined by the user.getClientScopes
(boolean defaultScope) Return all default scopes (if 'defaultScope' is true) or all optional scopes (if 'defaultScope' is false) linked with this clientgetDynamicClientScope
(String scope) Returns aClientScopeModel
associated with this client.getId()
Returns client internal ID (UUID).getName()
int
int
Time in seconds since epocgetProtocolMapperByName
(String protocol, String name) Returns protocol mappers as a stream.getRealm()
From the scope mappings returned byScopeContainerModel.getScopeMappingsStream()
returns only those that belong to the realm that owns this scope container.Returns available roles as a stream.getRolesStream
(Integer firstResult, Integer maxResults) Returns available roles as a stream.Returns scope mappings for this scope container as a stream.boolean
hasDirectScope
(RoleModel role) Returnstrue
, if this object has the given role directly in its scope.boolean
Returnstrue
, if this object has the given role directly or indirectly in its scope,false
otherwise.boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
void
registerNode
(String nodeHost, int registrationTime) Register node or just update the 'lastReRegistration' time if this node is already registeredvoid
removeAttribute
(String name) void
void
removeClientScope
(ClientScopeModel clientScope) void
removeProtocolMapper
(ProtocolMapperModel mapping) void
removeRedirectUri
(String redirectUri) boolean
removeRole
(RoleModel role) void
removeWebOrigin
(String webOrigin) searchForRolesStream
(String search, Integer first, Integer max) Searches roles by the given name.void
setAlwaysDisplayInConsole
(boolean alwaysDisplayInConsole) void
setAttribute
(String name, String value) void
setAuthenticationFlowBindingOverride
(String binding, String flowId) void
setBaseUrl
(String url) void
setBearerOnly
(boolean only) void
setClientAuthenticatorType
(String clientAuthenticatorType) void
setClientId
(String clientId) void
setConsentRequired
(boolean consentRequired) void
setConsentScreenText
(String consentScreenText) void
setDescription
(String description) void
setDirectAccessGrantsEnabled
(boolean directAccessGrantsEnabled) void
setDisplayOnConsentScreen
(boolean displayOnConsentScreen) void
setEnabled
(boolean enabled) void
setFrontchannelLogout
(boolean flag) void
setFullScopeAllowed
(boolean value) void
setGuiOrder
(String guiOrder) void
setImplicitFlowEnabled
(boolean implicitFlowEnabled) void
setIncludeInTokenScope
(boolean includeInTokenScope) void
setIsDynamicScope
(boolean isDynamicScope) void
setManagementUrl
(String url) void
void
setNodeReRegistrationTimeout
(int timeout) void
setNotBefore
(int notBefore) void
setProtocol
(String protocol) void
setPublicClient
(boolean flag) void
setRedirectUris
(Set<String> redirectUris) void
setRegistrationToken
(String registrationToken) void
setRootUrl
(String url) void
void
setServiceAccountsEnabled
(boolean serviceAccountsEnabled) void
setStandardFlowEnabled
(boolean standardFlowEnabled) void
setSurrogateAuthRequired
(boolean surrogateAuthRequired) void
setWebOrigins
(Set<String> webOrigins) void
unregisterNode
(String nodeHost) void
Notifies other providers that this client has been updated.void
updateProtocolMapper
(ProtocolMapperModel mapping) boolean
validateSecret
(String secret) 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.ClientModel
getType, setType
-
Constructor Details
-
ClientModelLazyDelegate
-
-
Method Details
-
updateClient
public void updateClient()Description copied from interface:ClientModel
Notifies other providers that this client has been updated.After a client is updated, providers can register for
ClientModel.ClientUpdatedEvent
. The setters in this model do not send an update for individual updates of the model. This method is here to allow for sending this event for this client, allowsing for to group multiple changes of a client and signal that all the changes in this client have been performed.- Specified by:
updateClient
in interfaceClientModel
- See Also:
-
getId
Description copied from interface:ClientModel
Returns client internal ID (UUID).- Specified by:
getId
in interfaceClientModel
- Specified by:
getId
in interfaceClientScopeModel
- Specified by:
getId
in interfaceRoleContainerModel
-
getClientId
Description copied from interface:ClientModel
Returns client ID as defined by the user.- Specified by:
getClientId
in interfaceClientModel
- Returns:
-
setClientId
- Specified by:
setClientId
in interfaceClientModel
-
getName
- Specified by:
getName
in interfaceClientModel
- Specified by:
getName
in interfaceClientScopeModel
-
setName
- Specified by:
setName
in interfaceClientModel
- Specified by:
setName
in interfaceClientScopeModel
-
getDescription
- Specified by:
getDescription
in interfaceClientModel
- Specified by:
getDescription
in interfaceClientScopeModel
-
setDescription
- Specified by:
setDescription
in interfaceClientModel
- Specified by:
setDescription
in interfaceClientScopeModel
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceClientModel
-
setEnabled
public void setEnabled(boolean enabled) - Specified by:
setEnabled
in interfaceClientModel
-
isAlwaysDisplayInConsole
public boolean isAlwaysDisplayInConsole()- Specified by:
isAlwaysDisplayInConsole
in interfaceClientModel
-
setAlwaysDisplayInConsole
public void setAlwaysDisplayInConsole(boolean alwaysDisplayInConsole) - Specified by:
setAlwaysDisplayInConsole
in interfaceClientModel
-
isSurrogateAuthRequired
public boolean isSurrogateAuthRequired()- Specified by:
isSurrogateAuthRequired
in interfaceClientModel
-
setSurrogateAuthRequired
public void setSurrogateAuthRequired(boolean surrogateAuthRequired) - Specified by:
setSurrogateAuthRequired
in interfaceClientModel
-
getWebOrigins
- Specified by:
getWebOrigins
in interfaceClientModel
-
setWebOrigins
- Specified by:
setWebOrigins
in interfaceClientModel
-
addWebOrigin
- Specified by:
addWebOrigin
in interfaceClientModel
-
removeWebOrigin
- Specified by:
removeWebOrigin
in interfaceClientModel
-
getRedirectUris
- Specified by:
getRedirectUris
in interfaceClientModel
-
setRedirectUris
- Specified by:
setRedirectUris
in interfaceClientModel
-
addRedirectUri
- Specified by:
addRedirectUri
in interfaceClientModel
-
removeRedirectUri
- Specified by:
removeRedirectUri
in interfaceClientModel
-
getManagementUrl
- Specified by:
getManagementUrl
in interfaceClientModel
-
setManagementUrl
- Specified by:
setManagementUrl
in interfaceClientModel
-
getRootUrl
- Specified by:
getRootUrl
in interfaceClientModel
-
setRootUrl
- Specified by:
setRootUrl
in interfaceClientModel
-
getBaseUrl
- Specified by:
getBaseUrl
in interfaceClientModel
-
setBaseUrl
- Specified by:
setBaseUrl
in interfaceClientModel
-
isBearerOnly
public boolean isBearerOnly()- Specified by:
isBearerOnly
in interfaceClientModel
-
setBearerOnly
public void setBearerOnly(boolean only) - Specified by:
setBearerOnly
in interfaceClientModel
-
getNodeReRegistrationTimeout
public int getNodeReRegistrationTimeout()- Specified by:
getNodeReRegistrationTimeout
in interfaceClientModel
-
setNodeReRegistrationTimeout
public void setNodeReRegistrationTimeout(int timeout) - Specified by:
setNodeReRegistrationTimeout
in interfaceClientModel
-
getClientAuthenticatorType
- Specified by:
getClientAuthenticatorType
in interfaceClientModel
-
setClientAuthenticatorType
- Specified by:
setClientAuthenticatorType
in interfaceClientModel
-
validateSecret
- Specified by:
validateSecret
in interfaceClientModel
-
getSecret
- Specified by:
getSecret
in interfaceClientModel
-
setSecret
- Specified by:
setSecret
in interfaceClientModel
-
getRegistrationToken
- Specified by:
getRegistrationToken
in interfaceClientModel
-
setRegistrationToken
- Specified by:
setRegistrationToken
in interfaceClientModel
-
getProtocol
- Specified by:
getProtocol
in interfaceClientModel
- Specified by:
getProtocol
in interfaceClientScopeModel
-
setProtocol
- Specified by:
setProtocol
in interfaceClientModel
- Specified by:
setProtocol
in interfaceClientScopeModel
-
setAttribute
- Specified by:
setAttribute
in interfaceClientModel
- Specified by:
setAttribute
in interfaceClientScopeModel
-
removeAttribute
- Specified by:
removeAttribute
in interfaceClientModel
- Specified by:
removeAttribute
in interfaceClientScopeModel
-
getAttribute
- Specified by:
getAttribute
in interfaceClientModel
- Specified by:
getAttribute
in interfaceClientScopeModel
-
getAttributes
- Specified by:
getAttributes
in interfaceClientModel
- Specified by:
getAttributes
in interfaceClientScopeModel
-
getAuthenticationFlowBindingOverride
Description copied from interface:ClientModel
Get authentication flow binding override for this client. Allows client to override an authentication flow binding.- Specified by:
getAuthenticationFlowBindingOverride
in interfaceClientModel
- Parameters:
binding
- examples are "browser", "direct_grant"- Returns:
-
getAuthenticationFlowBindingOverrides
- Specified by:
getAuthenticationFlowBindingOverrides
in interfaceClientModel
-
removeAuthenticationFlowBindingOverride
- Specified by:
removeAuthenticationFlowBindingOverride
in interfaceClientModel
-
setAuthenticationFlowBindingOverride
- Specified by:
setAuthenticationFlowBindingOverride
in interfaceClientModel
-
isFrontchannelLogout
public boolean isFrontchannelLogout()- Specified by:
isFrontchannelLogout
in interfaceClientModel
-
setFrontchannelLogout
public void setFrontchannelLogout(boolean flag) - Specified by:
setFrontchannelLogout
in interfaceClientModel
-
isFullScopeAllowed
public boolean isFullScopeAllowed()- Specified by:
isFullScopeAllowed
in interfaceClientModel
-
setFullScopeAllowed
public void setFullScopeAllowed(boolean value) - Specified by:
setFullScopeAllowed
in interfaceClientModel
-
isPublicClient
public boolean isPublicClient()- Specified by:
isPublicClient
in interfaceClientModel
-
setPublicClient
public void setPublicClient(boolean flag) - Specified by:
setPublicClient
in interfaceClientModel
-
isConsentRequired
public boolean isConsentRequired()- Specified by:
isConsentRequired
in interfaceClientModel
-
setConsentRequired
public void setConsentRequired(boolean consentRequired) - Specified by:
setConsentRequired
in interfaceClientModel
-
isStandardFlowEnabled
public boolean isStandardFlowEnabled()- Specified by:
isStandardFlowEnabled
in interfaceClientModel
-
setStandardFlowEnabled
public void setStandardFlowEnabled(boolean standardFlowEnabled) - Specified by:
setStandardFlowEnabled
in interfaceClientModel
-
isImplicitFlowEnabled
public boolean isImplicitFlowEnabled()- Specified by:
isImplicitFlowEnabled
in interfaceClientModel
-
setImplicitFlowEnabled
public void setImplicitFlowEnabled(boolean implicitFlowEnabled) - Specified by:
setImplicitFlowEnabled
in interfaceClientModel
-
isDirectAccessGrantsEnabled
public boolean isDirectAccessGrantsEnabled()- Specified by:
isDirectAccessGrantsEnabled
in interfaceClientModel
-
setDirectAccessGrantsEnabled
public void setDirectAccessGrantsEnabled(boolean directAccessGrantsEnabled) - Specified by:
setDirectAccessGrantsEnabled
in interfaceClientModel
-
isServiceAccountsEnabled
public boolean isServiceAccountsEnabled()- Specified by:
isServiceAccountsEnabled
in interfaceClientModel
-
setServiceAccountsEnabled
public void setServiceAccountsEnabled(boolean serviceAccountsEnabled) - Specified by:
setServiceAccountsEnabled
in interfaceClientModel
-
getRealm
- Specified by:
getRealm
in interfaceClientModel
- Specified by:
getRealm
in interfaceClientScopeModel
-
addClientScope
Description copied from interface:ClientModel
Add clientScope with this client. Add it as default scope (if parameter 'defaultScope' is true) or optional scope (if parameter 'defaultScope' is false)- Specified by:
addClientScope
in interfaceClientModel
-
addClientScopes
Description copied from interface:ClientModel
Add clientScopes with this client. Add as default scopes (if parameter 'defaultScope' is true) or optional scopes (if parameter 'defaultScope' is false)- Specified by:
addClientScopes
in interfaceClientModel
-
removeClientScope
- Specified by:
removeClientScope
in interfaceClientModel
-
getClientScopes
Description copied from interface:ClientModel
Return all default scopes (if 'defaultScope' is true) or all optional scopes (if 'defaultScope' is false) linked with this client- Specified by:
getClientScopes
in interfaceClientModel
- Returns:
- map where key is the name of the clientScope, value is particular clientScope. Returns empty map if no scopes linked (never returns null).
-
getDynamicClientScope
Description copied from interface:ClientModel
Returns a
ClientScopeModel
associated with this client.This method is used as a fallback in order to let clients to resolve a
scope
dynamically which is not listed as default or optional scope when calling#getClientScopes(boolean, boolean)
.- Specified by:
getDynamicClientScope
in interfaceClientModel
- Parameters:
scope
- the scope name- Returns:
- the client scope
-
getNotBefore
public int getNotBefore()Description copied from interface:ClientModel
Time in seconds since epoc- Specified by:
getNotBefore
in interfaceClientModel
- Returns:
-
setNotBefore
public void setNotBefore(int notBefore) - Specified by:
setNotBefore
in interfaceClientModel
-
getRegisteredNodes
- Specified by:
getRegisteredNodes
in interfaceClientModel
-
registerNode
Description copied from interface:ClientModel
Register node or just update the 'lastReRegistration' time if this node is already registered- Specified by:
registerNode
in interfaceClientModel
-
unregisterNode
- Specified by:
unregisterNode
in interfaceClientModel
-
isDisplayOnConsentScreen
public boolean isDisplayOnConsentScreen()- Specified by:
isDisplayOnConsentScreen
in interfaceClientModel
- Specified by:
isDisplayOnConsentScreen
in interfaceClientScopeModel
-
getConsentScreenText
- Specified by:
getConsentScreenText
in interfaceClientModel
- Specified by:
getConsentScreenText
in interfaceClientScopeModel
-
setDisplayOnConsentScreen
public void setDisplayOnConsentScreen(boolean displayOnConsentScreen) - Specified by:
setDisplayOnConsentScreen
in interfaceClientScopeModel
-
setConsentScreenText
- Specified by:
setConsentScreenText
in interfaceClientScopeModel
-
getGuiOrder
- Specified by:
getGuiOrder
in interfaceClientScopeModel
- Specified by:
getGuiOrder
in interfaceOrderedModel
-
setGuiOrder
- Specified by:
setGuiOrder
in interfaceClientScopeModel
-
isIncludeInTokenScope
public boolean isIncludeInTokenScope()- Specified by:
isIncludeInTokenScope
in interfaceClientScopeModel
-
setIncludeInTokenScope
public void setIncludeInTokenScope(boolean includeInTokenScope) - Specified by:
setIncludeInTokenScope
in interfaceClientScopeModel
-
isDynamicScope
public boolean isDynamicScope()- Specified by:
isDynamicScope
in interfaceClientScopeModel
-
setIsDynamicScope
public void setIsDynamicScope(boolean isDynamicScope) - Specified by:
setIsDynamicScope
in interfaceClientScopeModel
-
getDynamicScopeRegexp
- Specified by:
getDynamicScopeRegexp
in interfaceClientScopeModel
-
getScopeMappingsStream
Description copied from interface:ScopeContainerModel
Returns scope mappings for this scope container as a stream.- Specified by:
getScopeMappingsStream
in interfaceScopeContainerModel
- Returns:
- Stream of
RoleModel
. Never returnsnull
.
-
getRealmScopeMappingsStream
Description copied from interface:ScopeContainerModel
From the scope mappings returned byScopeContainerModel.getScopeMappingsStream()
returns only those that belong to the realm that owns this scope container.- Specified by:
getRealmScopeMappingsStream
in interfaceScopeContainerModel
- Returns:
- stream of
RoleModel
. Never returnsnull
.
-
addScopeMapping
- Specified by:
addScopeMapping
in interfaceScopeContainerModel
-
deleteScopeMapping
- Specified by:
deleteScopeMapping
in interfaceScopeContainerModel
-
hasDirectScope
Description copied from interface:ScopeContainerModel
Returnstrue
, if this object has the given role directly in its scope.- Specified by:
hasDirectScope
in interfaceClientModel
- Specified by:
hasDirectScope
in interfaceScopeContainerModel
- Parameters:
role
- the role- Returns:
- see description
- See Also:
-
hasScope
Description copied from interface:ScopeContainerModel
Returnstrue
, if this object has the given role directly or indirectly in its scope,false
otherwise.- Specified by:
hasScope
in interfaceScopeContainerModel
- Parameters:
role
- the role- Returns:
- see description
- See Also:
-
getRole
- Specified by:
getRole
in interfaceRoleContainerModel
-
addRole
- Specified by:
addRole
in interfaceRoleContainerModel
-
addRole
- Specified by:
addRole
in interfaceRoleContainerModel
-
removeRole
- Specified by:
removeRole
in interfaceRoleContainerModel
-
getRolesStream
Description copied from interface:RoleContainerModel
Returns available roles as a stream.- Specified by:
getRolesStream
in interfaceRoleContainerModel
- Returns:
- Stream of
RoleModel
. Never returnsnull
.
-
getRolesStream
Description copied from interface:RoleContainerModel
Returns available roles as a stream.- Specified by:
getRolesStream
in interfaceRoleContainerModel
- Parameters:
firstResult
-Integer
Index of the first desired role. Ignored if negative ornull
.maxResults
-Integer
Maximum number of returned roles. Ignored if negative ornull
.- Returns:
- Stream of
RoleModel
. Never returnsnull
.
-
searchForRolesStream
Description copied from interface:RoleContainerModel
Searches roles by the given name. Returns all roles that match the given filter.- Specified by:
searchForRolesStream
in interfaceRoleContainerModel
- Parameters:
search
-String
Name of the role to be used as a filter.first
-Integer
Index of the first desired role. Ignored if negative ornull
.max
-Integer
Maximum number of returned roles. Ignored if negative ornull
.- Returns:
- Stream of
RoleModel
. Never returnsnull
.
-
getProtocolMappersStream
Description copied from interface:ProtocolMapperContainerModel
Returns protocol mappers as a stream.- Specified by:
getProtocolMappersStream
in interfaceProtocolMapperContainerModel
- Returns:
- Stream of protocol mapper. Never returns
null
.
-
addProtocolMapper
- Specified by:
addProtocolMapper
in interfaceProtocolMapperContainerModel
-
removeProtocolMapper
- Specified by:
removeProtocolMapper
in interfaceProtocolMapperContainerModel
-
updateProtocolMapper
- Specified by:
updateProtocolMapper
in interfaceProtocolMapperContainerModel
-
getProtocolMapperById
- Specified by:
getProtocolMapperById
in interfaceProtocolMapperContainerModel
-
getProtocolMapperByName
- Specified by:
getProtocolMapperByName
in interfaceProtocolMapperContainerModel
-