Great Article! Good job!
A quick question: Why here are you checking the header and not the authentication object?
I mean, you already checked the header in getAuthentication()
getAuthentication()
var authentication = getAuthentication(request); var header = request.getHeader(SecurityConstants.TOKEN_HEADER); if (StringUtils.isEmpty(header) || !header.startsWith(SecurityConstants.TOKEN_PREFIX)) { filterChain.doFilter(request, response); return; }
Like this, should also work, or not? :D
var authentication = getAuthentication(request); if (authentication == null) { filterChain.doFilter(request, response); return; }
Again, great article!
Well, you're right. My bad 😀 I'll update the code. Thanks for your attention 🙂
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Great Article! Good job!
A quick question: Why here are you checking the header and not the authentication object?
I mean, you already checked the header in
getAuthentication()
Like this, should also work, or not? :D
Again, great article!
Well, you're right. My bad 😀
I'll update the code. Thanks for your attention 🙂