public class MapClientProvider extends Object implements ClientProvider
| Constructor and Description |
|---|
MapClientProvider(KeycloakSession session,
MapStorage<MapClientEntity,ClientModel> clientStore,
ConcurrentMap<String,ConcurrentMap<String,Integer>> clientRegisteredNodesStore) |
| Modifier and Type | Method and Description |
|---|---|
ClientModel |
addClient(RealmModel realm,
String id,
String clientId)
Adds a client with given internal ID and
clientId to the given realm. |
void |
addClientScopes(RealmModel realm,
ClientModel client,
Set<ClientScopeModel> clientScopes,
boolean defaultScope)
Assign clientScopes to the client.
|
void |
close() |
Map<ClientModel,Set<String>> |
getAllRedirectUrisOfEnabledClients(RealmModel realm)
Returns a map of (rootUrl, {validRedirectUris}) for all enabled clients.
|
Stream<ClientModel> |
getAlwaysDisplayInConsoleClientsStream(RealmModel realm)
Returns a stream of clients that are expected to always show up in account console.
|
ClientModel |
getClientByClientId(RealmModel realm,
String clientId)
Exact search for a client by its public client identifier.
|
ClientModel |
getClientById(RealmModel realm,
String id)
Exact search for a client by its internal ID.
|
Map<String,ClientScopeModel> |
getClientScopes(RealmModel realm,
ClientModel client,
boolean defaultScopes)
Return all default scopes (if
defaultScope is true) or all optional scopes (if defaultScope is false) linked with the client |
long |
getClientsCount(RealmModel realm)
Returns number of clients in the given realm
|
Stream<ClientModel> |
getClientsStream(RealmModel realm)
Returns all the clients of the given realm as a stream.
|
Stream<ClientModel> |
getClientsStream(RealmModel realm,
Integer firstResult,
Integer maxResults)
Returns the clients of the given realm as a stream.
|
void |
preRemove(RealmModel realm,
RoleModel role) |
boolean |
removeClient(RealmModel realm,
String id)
Removes given client from the given realm.
|
void |
removeClients(RealmModel realm)
Removes all clients from the given realm.
|
void |
removeClientScope(RealmModel realm,
ClientModel client,
ClientScopeModel clientScope)
Unassign clientScope from the client.
|
Stream<ClientModel> |
searchClientsByAttributes(RealmModel realm,
Map<String,String> attributes,
Integer firstResult,
Integer maxResults) |
Stream<ClientModel> |
searchClientsByClientIdStream(RealmModel realm,
String clientId,
Integer firstResult,
Integer maxResults)
Case-insensitive search for clients that contain the given string in their public client identifier.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddClient, getAlwaysDisplayInConsoleClients, getClients, getClients, removeClientgetClientByClientId, getClientById, searchClientsByClientIdpublic MapClientProvider(KeycloakSession session, MapStorage<MapClientEntity,ClientModel> clientStore, ConcurrentMap<String,ConcurrentMap<String,Integer>> clientRegisteredNodesStore)
public Stream<ClientModel> getClientsStream(RealmModel realm, Integer firstResult, Integer maxResults)
ClientProvidergetClientsStream in interface ClientProviderrealm - Realm.firstResult - First result to return. Ignored if negative or null.maxResults - Maximum number of results to return. Ignored if negative or null.null.public Stream<ClientModel> getClientsStream(RealmModel realm)
ClientProvidergetClientsStream(realm, null, null).getClientsStream in interface ClientProviderrealm - Realm.null.public ClientModel addClient(RealmModel realm, String id, String clientId)
ClientProviderclientId to the given realm.addClient in interface ClientProviderrealm - Realm owning this client.id - Internal ID of the client or null if one is to be created by the underlying storeclientId - String that identifies the client to the external parties.
Maps to client_id in OIDC or entityID in SAML.public Stream<ClientModel> getAlwaysDisplayInConsoleClientsStream(RealmModel realm)
ClientProvidergetAlwaysDisplayInConsoleClientsStream in interface ClientProviderrealm - Realm owning the clients.null.public void removeClients(RealmModel realm)
ClientProviderremoveClients in interface ClientProviderrealm - Realm.public boolean removeClient(RealmModel realm, String id)
ClientProviderremoveClient in interface ClientProviderrealm - Realm.id - Internal ID of the clienttrue if the client existed and has been removed, false otherwise.public long getClientsCount(RealmModel realm)
ClientProvidergetClientsCount in interface ClientProviderrealm - Realm.public ClientModel getClientById(RealmModel realm, String id)
ClientLookupProvidergetClientById in interface ClientLookupProviderrealm - Realm to limit the search.id - Internal IDnull if no client is found.public ClientModel getClientByClientId(RealmModel realm, String clientId)
ClientLookupProvidergetClientByClientId in interface ClientLookupProviderrealm - Realm to limit the search for clients.clientId - String that identifies the client to the external parties.
Maps to client_id in OIDC or entityID in SAML.null if no client is found.public Stream<ClientModel> searchClientsByClientIdStream(RealmModel realm, String clientId, Integer firstResult, Integer maxResults)
ClientLookupProvidersearchClientsByClientIdStream in interface ClientLookupProviderrealm - Realm to limit the search for clients.clientId - Searched substring of the public client
identifier (client_id in OIDC or entityID in SAML.)firstResult - First result to return. Ignored if negative or null.maxResults - Maximum number of results to return. Ignored if negative or null.null.public Stream<ClientModel> searchClientsByAttributes(RealmModel realm, Map<String,String> attributes, Integer firstResult, Integer maxResults)
searchClientsByAttributes in interface ClientLookupProviderpublic void addClientScopes(RealmModel realm, ClientModel client, Set<ClientScopeModel> clientScopes, boolean defaultScope)
ClientProvideraddClientScopes in interface ClientProviderrealm - Realm.client - Client.clientScopes - to be assigneddefaultScope - if true the scopes are assigned as default, or optional in case of falsepublic void removeClientScope(RealmModel realm, ClientModel client, ClientScopeModel clientScope)
ClientProviderremoveClientScope in interface ClientProviderrealm - Realm.client - Client.clientScope - to be unassignedpublic Map<String,ClientScopeModel> getClientScopes(RealmModel realm, ClientModel client, boolean defaultScopes)
ClientLookupProviderdefaultScope is true) or all optional scopes (if defaultScope is false) linked with the clientgetClientScopes in interface ClientLookupProviderrealm - Realmclient - ClientdefaultScopes - if true default scopes, if false optional scopes, are returnedpublic Map<ClientModel,Set<String>> getAllRedirectUrisOfEnabledClients(RealmModel realm)
ClientProvidergetAllRedirectUrisOfEnabledClients in interface ClientProviderpublic void preRemove(RealmModel realm, RoleModel role)
Copyright © 2021 JBoss by Red Hat. All rights reserved.