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

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The constant AUTHORIZATION_KEY.
    static final String
    The constant AUTHORIZATION_TOKEN_KEY.
  • Constructor Summary

    Constructors
    Constructor
    Description
    HvlAuthOidcRedisServiceImpl(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 Type
    Method
    Description
    org.springframework.security.oauth2.server.authorization.OAuth2Authorization
    findById(@NotBlank String id)
    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)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • AUTHORIZATION_TOKEN_KEY

      public static final String AUTHORIZATION_TOKEN_KEY
      The constant AUTHORIZATION_TOKEN_KEY.
      See Also:
    • AUTHORIZATION_KEY

      public static final String 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 template
      redisCacheManagerProperties - 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 interface org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService
    • remove

      public void remove(@NotNull @NotNull org.springframework.security.oauth2.server.authorization.OAuth2Authorization authorizationContext)
      Specified by:
      remove in interface org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService
    • findById

      public org.springframework.security.oauth2.server.authorization.OAuth2Authorization findById(@NotBlank @NotBlank String id)
      Specified by:
      findById in interface org.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 interface org.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 type
      tokenValue - the token value
      Returns:
      the authorization token key
    • getAuthorizationKey

      protected String getAuthorizationKey(String authorizationId)
      Gets authorization key.
      Parameters:
      authorizationId - the authorization id
      Returns:
      the authorization key