Class InMemoryOAuth2AuthorizationService
java.lang.Object
org.springframework.security.oauth2.server.authorization.InMemoryOAuth2AuthorizationService
- All Implemented Interfaces:
OAuth2AuthorizationService
public final class InMemoryOAuth2AuthorizationService
extends Object
implements OAuth2AuthorizationService
An
OAuth2AuthorizationService that stores OAuth2Authorization's
in-memory.
NOTE: This implementation should ONLY be used during development/testing.
- Since:
- 0.0.1
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs anInMemoryOAuth2AuthorizationService.InMemoryOAuth2AuthorizationService(List<OAuth2Authorization> authorizations) Constructs anInMemoryOAuth2AuthorizationServiceusing the provided parameters.InMemoryOAuth2AuthorizationService(OAuth2Authorization... authorizations) Constructs anInMemoryOAuth2AuthorizationServiceusing the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionfindByToken(String token, OAuth2TokenType tokenType) voidremove(OAuth2Authorization authorization) Removes theOAuth2Authorization.voidsave(OAuth2Authorization authorization) Saves theOAuth2Authorization.
-
Constructor Details
-
InMemoryOAuth2AuthorizationService
public InMemoryOAuth2AuthorizationService()Constructs anInMemoryOAuth2AuthorizationService. -
InMemoryOAuth2AuthorizationService
Constructs anInMemoryOAuth2AuthorizationServiceusing the provided parameters.- Parameters:
authorizations- the authorization(s)
-
InMemoryOAuth2AuthorizationService
Constructs anInMemoryOAuth2AuthorizationServiceusing the provided parameters.- Parameters:
authorizations- the authorization(s)
-
-
Method Details
-
save
Description copied from interface:OAuth2AuthorizationServiceSaves theOAuth2Authorization.- Specified by:
savein interfaceOAuth2AuthorizationService- Parameters:
authorization- theOAuth2Authorization
-
remove
Description copied from interface:OAuth2AuthorizationServiceRemoves theOAuth2Authorization.- Specified by:
removein interfaceOAuth2AuthorizationService- Parameters:
authorization- theOAuth2Authorization
-
findById
Description copied from interface:OAuth2AuthorizationService- Specified by:
findByIdin interfaceOAuth2AuthorizationService- Parameters:
id- the authorization identifier- Returns:
- the
OAuth2Authorizationif found, otherwisenull
-
findByToken
Description copied from interface:OAuth2AuthorizationService- Specified by:
findByTokenin interfaceOAuth2AuthorizationService- Parameters:
token- the token credentialtokenType- thetoken type- Returns:
- the
OAuth2Authorizationif found, otherwisenull
-