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 TypeMethodDescriptioncreate(CreateClientEntity client) Deprecated.findRedirectUrisByClientId(String clientId) Gets an existing redirect urigetByClientId(String clientId) Gets an existingClientGets an existingClientgetByRotatedClientId(String clientId) Gets an existingClientby rotated client idbooleanisClientNameUnique(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.booleanisClientValid(String clientId, String clientSecret, FlowType flowType) Checks if the client is valid for the given flow typelist()Gets all ClientremoveById(String id) Deletes aClientresetClientSecret(String clientId) Revokes the client secret and id for the rotated client, by removing the values.rotateClient(String clientId) Rotate the client id and secret for the given client id.updateClient(UpdateClientEntity client) Deprecated.
-
Method Details
-
create
@Deprecated @Nonnull Client create(@Nonnull String name, Scope scope, @Nonnull List<String> redirectUris) Deprecated.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
-
create
-
updateClient
@Deprecated Optional<Client> updateClient(@Nonnull String id, String name, String scope, @Nonnull List<String> redirectUris) Deprecated.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
-
updateClient
-
resetClientSecret
-
rotateClient
Rotate the client id and secret for the given client id.- Parameters:
clientId- the client id to rotate- Returns:
- the new client id and secret
- Since:
- 5.0.0
-
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
-
getByRotatedClientId
Gets an existingClientby rotated client id- 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
-
isClientValid
boolean isClientValid(@Nonnull String clientId, @Nonnull String clientSecret, @Nonnull FlowType flowType) Checks if the client is valid for the given flow type- Parameters:
clientId- id of the clientclientSecret- secret of the clientflowType- the flow type of the client that will determine if a client secret is required- Returns:
- true if the client is valid for the given flow type
- Since:
- 5.0.0
-
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
-
revokeRotatedClientSecret
Revokes the client secret and id for the rotated client, by removing the values. This is used to remove the old client id and secret pair.- Parameters:
id- used to identify the client which should have the rotated pair revoked.- Returns:
- The
Optionalof theClientmatching the id, or, if the id not found it will returnOptional.empty() - Since:
- 5.0.0
-