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
ConstructorsConstructorDescriptionConstructs anInMemoryOAuth2AuthorizationConsentService.InMemoryOAuth2AuthorizationConsentService(List<OAuth2AuthorizationConsent> authorizationConsents) Constructs anInMemoryOAuth2AuthorizationConsentServiceusing the provided parameters.InMemoryOAuth2AuthorizationConsentService(OAuth2AuthorizationConsent... authorizationConsents) Constructs anInMemoryOAuth2AuthorizationConsentServiceusing the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionReturns theOAuth2AuthorizationConsentidentified by the providedregisteredClientIdandprincipalName, ornullif not found.voidremove(OAuth2AuthorizationConsent authorizationConsent) Removes theOAuth2AuthorizationConsent.voidsave(OAuth2AuthorizationConsent authorizationConsent) Saves theOAuth2AuthorizationConsent.
-
Constructor Details
-
InMemoryOAuth2AuthorizationConsentService
public InMemoryOAuth2AuthorizationConsentService()Constructs anInMemoryOAuth2AuthorizationConsentService. -
InMemoryOAuth2AuthorizationConsentService
public InMemoryOAuth2AuthorizationConsentService(OAuth2AuthorizationConsent... authorizationConsents) Constructs anInMemoryOAuth2AuthorizationConsentServiceusing the provided parameters.- Parameters:
authorizationConsents- the authorization consent(s)
-
InMemoryOAuth2AuthorizationConsentService
public InMemoryOAuth2AuthorizationConsentService(List<OAuth2AuthorizationConsent> authorizationConsents) Constructs anInMemoryOAuth2AuthorizationConsentServiceusing the provided parameters.- Parameters:
authorizationConsents- the authorization consent(s)
-
-
Method Details
-
save
Description copied from interface:OAuth2AuthorizationConsentServiceSaves theOAuth2AuthorizationConsent.- Specified by:
savein interfaceOAuth2AuthorizationConsentService- Parameters:
authorizationConsent- theOAuth2AuthorizationConsent
-
remove
Description copied from interface:OAuth2AuthorizationConsentServiceRemoves theOAuth2AuthorizationConsent.- Specified by:
removein interfaceOAuth2AuthorizationConsentService- Parameters:
authorizationConsent- theOAuth2AuthorizationConsent
-
findById
@Nullable public OAuth2AuthorizationConsent findById(String registeredClientId, String principalName) Description copied from interface:OAuth2AuthorizationConsentServiceReturns theOAuth2AuthorizationConsentidentified by the providedregisteredClientIdandprincipalName, ornullif not found.- Specified by:
findByIdin interfaceOAuth2AuthorizationConsentService- Parameters:
registeredClientId- the identifier for theRegisteredClientprincipalName- the name of thePrincipal- Returns:
- the
OAuth2AuthorizationConsentif found, otherwisenull
-