Package org.keycloak.models
Interface ClientScopeProvider
- All Superinterfaces:
ClientScopeLookupProvider,Provider
- All Known Subinterfaces:
CacheRealmProvider
- All Known Implementing Classes:
ClientScopeStorageManager,JpaRealmProvider,RealmCacheSession
Provider of the client scopes records.
-
Method Summary
Modifier and TypeMethodDescriptiondefault ClientScopeModeladdClientScope(RealmModel realm, String name) Creates new client scope with givennameto the given realm.addClientScope(RealmModel realm, String id, String name) Creates new client scope with given internal ID andnameto the given realm.getClientScopesByAttributes(RealmModel realm, Map<String, String> searchMap, boolean useOr) Allows us to filter for scopes by specific attributesgetClientScopesByProtocol(RealmModel realm, String protocol) Must retrieve all client scopes of the given realm that are use the given protocol.getClientScopesStream(RealmModel realm) Returns all the client scopes of the given realm as a stream.booleanremoveClientScope(RealmModel realm, String id) Removes client scope from the given realm.voidremoveClientScopes(RealmModel realm) Removes all client scopes from the given realm.Methods inherited from interface org.keycloak.storage.clientscope.ClientScopeLookupProvider
getClientScopeById
-
Method Details
-
getClientScopesStream
Returns all the client scopes of the given realm as a stream.- Parameters:
realm- Realm.- Returns:
- Stream of the client scopes. Never returns
null.
-
addClientScope
Creates new client scope with givennameto the given realm. Spaces innamewill be replaced by underscore so that scope name can be used as value of scope parameter. The internal ID will be created automatically.- Parameters:
realm- Realm owning this client scope.name- String name of the client scope.- Returns:
- Model of the created client scope.
- Throws:
ModelDuplicateException- if client scope with given name already exists
-
addClientScope
Creates new client scope with given internal ID andnameto the given realm. Spaces innamewill be replaced by underscore so that scope name can be used as value of scope parameter.- Parameters:
realm- Realm owning this client scope.id- Internal ID of the client scope ornullif one is to be created by the underlying storename- String name of the client scope.- Returns:
- Model of the created client scope.
- Throws:
IllegalArgumentException- Ifiddoes not conform the format understood by the underlying store.ModelDuplicateException- if client scope with given name already exists
-
removeClientScope
Removes client scope from the given realm.- Parameters:
realm- Realm.id- Internal ID of the client scope- Returns:
trueif the client scope existed and has been removed,falseotherwise.- Throws:
ModelException- if client scope is in use.
-
removeClientScopes
Removes all client scopes from the given realm.- Parameters:
realm- Realm.
-
getClientScopesByProtocol
Must retrieve all client scopes of the given realm that are use the given protocol.- Parameters:
realm- the realm to retrieve the client scopes from.protocol- the protocol expected from the clientScope
-
getClientScopesByAttributes
Stream<ClientScopeModel> getClientScopesByAttributes(RealmModel realm, Map<String, String> searchMap, boolean useOr) Allows us to filter for scopes by specific attributes- Parameters:
realm- Realm.searchMap- a key-value map that holds the attribute names and values to search for.useOr- If the search-params should be combined with or-expressions or and-expressions
-