Class InMemoryRegisteredClientRepository
java.lang.Object
org.springframework.security.oauth2.server.authorization.client.InMemoryRegisteredClientRepository
- All Implemented Interfaces:
RegisteredClientRepository
public final class InMemoryRegisteredClientRepository
extends Object
implements RegisteredClientRepository
A
RegisteredClientRepository that stores RegisteredClient(s) in-memory.
NOTE: This implementation is recommended ONLY to be used during development/testing.
- Since:
- 7.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionInMemoryRegisteredClientRepository(List<RegisteredClient> registrations) Constructs anInMemoryRegisteredClientRepositoryusing the provided parameters.InMemoryRegisteredClientRepository(RegisteredClient... registrations) Constructs anInMemoryRegisteredClientRepositoryusing the provided parameters. -
Method Summary
Modifier and TypeMethodDescription@Nullable RegisteredClientfindByClientId(String clientId) Returns the registered client identified by the providedclientId, ornullif not found.@Nullable RegisteredClientReturns the registered client identified by the providedid, ornullif not found.voidsave(RegisteredClient registeredClient) Saves the registered client.
-
Constructor Details
-
InMemoryRegisteredClientRepository
Constructs anInMemoryRegisteredClientRepositoryusing the provided parameters.- Parameters:
registrations- the client registration(s)
-
InMemoryRegisteredClientRepository
Constructs anInMemoryRegisteredClientRepositoryusing the provided parameters.- Parameters:
registrations- the client registration(s)
-
-
Method Details
-
save
Description copied from interface:RegisteredClientRepositorySaves the registered client.IMPORTANT: Sensitive information should be encoded externally from the implementation, e.g.
RegisteredClient.getClientSecret()- Specified by:
savein interfaceRegisteredClientRepository- Parameters:
registeredClient- theRegisteredClient
-
findById
Description copied from interface:RegisteredClientRepositoryReturns the registered client identified by the providedid, ornullif not found.- Specified by:
findByIdin interfaceRegisteredClientRepository- Parameters:
id- the registration identifier- Returns:
- the
RegisteredClientif found, otherwisenull
-
findByClientId
Description copied from interface:RegisteredClientRepositoryReturns the registered client identified by the providedclientId, ornullif not found.- Specified by:
findByClientIdin interfaceRegisteredClientRepository- Parameters:
clientId- the client identifier- Returns:
- the
RegisteredClientif found, otherwisenull
-