Created
January 30, 2022 19:52
-
-
Save GaetanoPiazzolla/7db7727152607a031e48063c1dbd5820 to your computer and use it in GitHub Desktop.
A blacklisting service. Uses standard springboot annotations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Service | |
public class BlackListingService { | |
@CachePut(CacheConfig.BLACKLIST_CACHE_NAME) | |
public String blackListJwt(String jwt) { | |
return jwt; | |
} | |
@Cacheable(value = CacheConfig.BLACKLIST_CACHE_NAME, unless = "#result == null") | |
public String getJwtBlackList(String jwt) { | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Related to medium article: https://blog.devgenius.io/fixing-jwt-insecure-session-termination-by-blacklisting-tokens-36d783adfd67