Class InMemoryOAuth2AuthorizationConsentService
java.lang.Object
org.springframework.security.oauth2.server.authorization.InMemoryOAuth2AuthorizationConsentService
- All Implemented Interfaces:
OAuth2AuthorizationConsentService
public final class InMemoryOAuth2AuthorizationConsentService
extends Object
implements OAuth2AuthorizationConsentService
An
OAuth2AuthorizationConsentService
that stores
OAuth2AuthorizationConsent
's in-memory.
NOTE: This implementation should ONLY be used during development/testing.
- Since:
- 0.1.2
- See Also:
-
Constructor Summary
ConstructorDescriptionConstructs anInMemoryOAuth2AuthorizationConsentService
.InMemoryOAuth2AuthorizationConsentService
(List<OAuth2AuthorizationConsent> authorizationConsents) Constructs anInMemoryOAuth2AuthorizationConsentService
using the provided parameters.InMemoryOAuth2AuthorizationConsentService
(OAuth2AuthorizationConsent... authorizationConsents) Constructs anInMemoryOAuth2AuthorizationConsentService
using the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionReturns theOAuth2AuthorizationConsent
identified by the providedregisteredClientId
andprincipalName
, ornull
if not found.void
remove
(OAuth2AuthorizationConsent authorizationConsent) Removes theOAuth2AuthorizationConsent
.void
save
(OAuth2AuthorizationConsent authorizationConsent) Saves theOAuth2AuthorizationConsent
.
-
Constructor Details
-
InMemoryOAuth2AuthorizationConsentService
public InMemoryOAuth2AuthorizationConsentService()Constructs anInMemoryOAuth2AuthorizationConsentService
. -
InMemoryOAuth2AuthorizationConsentService
public InMemoryOAuth2AuthorizationConsentService(OAuth2AuthorizationConsent... authorizationConsents) Constructs anInMemoryOAuth2AuthorizationConsentService
using the provided parameters.- Parameters:
authorizationConsents
- the authorization consent(s)
-
InMemoryOAuth2AuthorizationConsentService
public InMemoryOAuth2AuthorizationConsentService(List<OAuth2AuthorizationConsent> authorizationConsents) Constructs anInMemoryOAuth2AuthorizationConsentService
using the provided parameters.- Parameters:
authorizationConsents
- the authorization consent(s)
-
-
Method Details
-
save
Description copied from interface:OAuth2AuthorizationConsentService
Saves theOAuth2AuthorizationConsent
.- Specified by:
save
in interfaceOAuth2AuthorizationConsentService
- Parameters:
authorizationConsent
- theOAuth2AuthorizationConsent
-
remove
Description copied from interface:OAuth2AuthorizationConsentService
Removes theOAuth2AuthorizationConsent
.- Specified by:
remove
in interfaceOAuth2AuthorizationConsentService
- Parameters:
authorizationConsent
- theOAuth2AuthorizationConsent
-
findById
@Nullable public OAuth2AuthorizationConsent findById(String registeredClientId, String principalName) Description copied from interface:OAuth2AuthorizationConsentService
Returns theOAuth2AuthorizationConsent
identified by the providedregisteredClientId
andprincipalName
, ornull
if not found.- Specified by:
findById
in interfaceOAuth2AuthorizationConsentService
- Parameters:
registeredClientId
- the identifier for theRegisteredClient
principalName
- the name of thePrincipal
- Returns:
- the
OAuth2AuthorizationConsent
if found, otherwisenull
-