Interface ClientService
public interface ClientService
Service for managing OAuth2 clients (from the provider's perspective).
When imported via OSGi, System Admin permission checks are enforced on all method calls.
-
Method Summary
Modifier and TypeMethodDescriptionCreates aClientfindRedirectUrisByClientId(String clientId) Gets an existing redirect urigetByClientId(String clientId) Gets an existingClientGets an existingClientbooleanisClientNameUnique(String clientId, String clientName) Checks if client name is uniquebooleanisClientSecretValid(String clientId, String clientSecret) Checks if the provided client secret is a match for the client secret stored against the client ID provideddefault booleanisClientSecretValid(String clientId, String clientSecret, FlowType flowType) Checks if the provided client secret is a match for the client secret stored against the client ID provided.list()Gets all ClientremoveById(String id) Deletes aClientresetClientSecret(String clientId) Updates an existingClient
-
Method Details
-
create
Creates aClient- Parameters:
name- the name of the clientscope- optional scope for client. If not specified then this will be saved as ALLredirectUris- the redirect uris of the client- Returns:
- the newly created entity
-
updateClient
Optional<Client> updateClient(@Nonnull String id, String name, String scope, @Nonnull List<String> redirectUris) Updates an existingClient- Parameters:
id- the id of the entity to updatename- the new name. Null means no update will occurredirectUris- the new redirectUri name
-
resetClientSecret
-
getById
Gets an existingClient- Parameters:
id- of the entity to return- Returns:
- The
Clientmatching the id or null
-
getByClientId
Gets an existingClient- Parameters:
clientId- of the entity to return- Returns:
- The
Clientmatching the id or null
-
findRedirectUrisByClientId
Gets an existing redirect uri- Parameters:
clientId- matching the entity to return- Returns:
- The redirect uri matching the id or empty
-
list
Gets all Client- Returns:
- the clients stored in the system
-
removeById
Deletes aClient- Parameters:
id- of the entity to delete
-
isClientNameUnique
Checks if client name is unique- Parameters:
clientId- id of the clientclientName- name of the client- Returns:
- true if client name is unique
-
isClientSecretValid
Checks if the provided client secret is a match for the client secret stored against the client ID provided- Parameters:
clientId- id of the clientclientSecret- secret of the client- Returns:
- true if provided client secret is a match
-
isClientSecretValid
default boolean isClientSecretValid(@Nonnull String clientId, @Nullable String clientSecret, @Nonnull FlowType flowType) Checks if the provided client secret is a match for the client secret stored against the client ID provided. If the flow type is a public flow then this will always be true- Parameters:
clientId- id of the clientclientSecret- secret of the client. Can be null if it is a public flowflowType- the flow type of the client that will determine if a client secret is required- Returns:
- true if provided client secret is a match or the secret is not required
- Since:
- 3.1.14
-