Package com.espacogeek.geek.utils
Class TokenUtils
java.lang.Object
com.espacogeek.geek.utils.TokenUtils
Utility for extracting the JWT access token from the current request.
Access tokens are read ONLY from the
Authorization: Bearer header —
never from cookies — to eliminate CSRF attack vectors.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionExtract the access token from the current request viaRequestContextHolder.resolveToken(jakarta.servlet.http.HttpServletRequest request) Extract the access token from theAuthorization: Bearerheader of the given request.
-
Constructor Details
-
TokenUtils
public TokenUtils()
-
-
Method Details
-
resolveToken
Extract the access token from theAuthorization: Bearerheader of the given request. Returnsnullif the header is absent or not in Bearer format. -
resolveToken
Extract the access token from the current request viaRequestContextHolder. Falls back to reading from theSecurityContextHolderwhen the servlet request is not available (e.g., deep inside a GraphQL execution context).
-