Class HvlAuthOidcRedisServiceImpl
java.lang.Object
tr.com.havelsan.javarch.oauth.auth.starter.oidc.redis.service.HvlAuthOidcRedisServiceImpl
- All Implemented Interfaces:
org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService
@Service
@Profile("redis")
public class HvlAuthOidcRedisServiceImpl
extends Object
implements org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService
The service stores the authorization token, code and context in redis.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionHvlAuthOidcRedisServiceImpl
(org.springframework.data.redis.core.RedisTemplate<String, Object> oidcRedisTemplate, tr.com.havelsan.javarch.cache.redis.configuration.properties.HvlRedisCacheManagerProperties redisCacheManagerProperties) Instantiates a new Hvl auth oidc redis service. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.oauth2.server.authorization.OAuth2Authorization
org.springframework.security.oauth2.server.authorization.OAuth2Authorization
findByToken
(@NotBlank String token, org.springframework.security.oauth2.server.authorization.OAuth2TokenType tokenType) protected String
getAuthorizationKey
(String authorizationId) Gets authorization key.protected String
getAuthorizationTokenKey
(org.springframework.security.oauth2.core.OAuth2Token token) Gets authorization token key.protected String
getAuthorizationTokenKey
(org.springframework.security.oauth2.server.authorization.OAuth2TokenType type, String tokenValue) Gets authorization token key.void
remove
(@NotNull org.springframework.security.oauth2.server.authorization.OAuth2Authorization authorizationContext) void
save
(@NotNull org.springframework.security.oauth2.server.authorization.OAuth2Authorization authorizationContext)
-
Field Details
-
AUTHORIZATION_TOKEN_KEY
The constant AUTHORIZATION_TOKEN_KEY.- See Also:
-
AUTHORIZATION_KEY
The constant AUTHORIZATION_KEY.- See Also:
-
-
Constructor Details
-
HvlAuthOidcRedisServiceImpl
public HvlAuthOidcRedisServiceImpl(@Qualifier("oidcRedisTemplate") org.springframework.data.redis.core.RedisTemplate<String, Object> oidcRedisTemplate, tr.com.havelsan.javarch.cache.redis.configuration.properties.HvlRedisCacheManagerProperties redisCacheManagerProperties) Instantiates a new Hvl auth oidc redis service.- Parameters:
oidcRedisTemplate
- the oidc redis templateredisCacheManagerProperties
- the redis cache manager properties
-
-
Method Details
-
save
public void save(@NotNull @NotNull org.springframework.security.oauth2.server.authorization.OAuth2Authorization authorizationContext) - Specified by:
save
in interfaceorg.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService
-
remove
public void remove(@NotNull @NotNull org.springframework.security.oauth2.server.authorization.OAuth2Authorization authorizationContext) - Specified by:
remove
in interfaceorg.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService
-
findById
public org.springframework.security.oauth2.server.authorization.OAuth2Authorization findById(@NotBlank @NotBlank String id) - Specified by:
findById
in interfaceorg.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService
-
findByToken
public org.springframework.security.oauth2.server.authorization.OAuth2Authorization findByToken(@NotBlank @NotBlank String token, org.springframework.security.oauth2.server.authorization.OAuth2TokenType tokenType) - Specified by:
findByToken
in interfaceorg.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService
-
getAuthorizationTokenKey
protected String getAuthorizationTokenKey(org.springframework.security.oauth2.core.OAuth2Token token) Gets authorization token key.- Parameters:
token
- the token- Returns:
- the authorization token key
-
getAuthorizationTokenKey
protected String getAuthorizationTokenKey(org.springframework.security.oauth2.server.authorization.OAuth2TokenType type, String tokenValue) Gets authorization token key.- Parameters:
type
- the typetokenValue
- the token value- Returns:
- the authorization token key
-
getAuthorizationKey
Gets authorization key.- Parameters:
authorizationId
- the authorization id- Returns:
- the authorization key
-