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 anInMemoryOAuth2AuthorizationService
using the provided parameters.InMemoryOAuth2AuthorizationService
(OAuth2Authorization... authorizations) Constructs anInMemoryOAuth2AuthorizationService
using the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionfindByToken
(String token, OAuth2TokenType tokenType) void
remove
(OAuth2Authorization authorization) Removes theOAuth2Authorization
.void
save
(OAuth2Authorization authorization) Saves theOAuth2Authorization
.
-
Constructor Details
-
InMemoryOAuth2AuthorizationService
public InMemoryOAuth2AuthorizationService()Constructs anInMemoryOAuth2AuthorizationService
. -
InMemoryOAuth2AuthorizationService
Constructs anInMemoryOAuth2AuthorizationService
using the provided parameters.- Parameters:
authorizations
- the authorization(s)
-
InMemoryOAuth2AuthorizationService
Constructs anInMemoryOAuth2AuthorizationService
using the provided parameters.- Parameters:
authorizations
- the authorization(s)
-
-
Method Details
-
save
Description copied from interface:OAuth2AuthorizationService
Saves theOAuth2Authorization
.- Specified by:
save
in interfaceOAuth2AuthorizationService
- Parameters:
authorization
- theOAuth2Authorization
-
remove
Description copied from interface:OAuth2AuthorizationService
Removes theOAuth2Authorization
.- Specified by:
remove
in interfaceOAuth2AuthorizationService
- Parameters:
authorization
- theOAuth2Authorization
-
findById
Description copied from interface:OAuth2AuthorizationService
- Specified by:
findById
in interfaceOAuth2AuthorizationService
- Parameters:
id
- the authorization identifier- Returns:
- the
OAuth2Authorization
if found, otherwisenull
-
findByToken
Description copied from interface:OAuth2AuthorizationService
- Specified by:
findByToken
in interfaceOAuth2AuthorizationService
- Parameters:
token
- the token credentialtokenType
- thetoken type
- Returns:
- the
OAuth2Authorization
if found, otherwisenull
-