What's new in EzyPlatform 1.3.1?
This release introduces a safer hexadecimal access token format, strengthens Bearer token parsing, separates token cleanup from view utilities, and improves authentication error handling across both Admin and Web.
-
Switched access tokens to a lowercase hexadecimal formatThe access token header has been changed from Base64 to
lowercase hexadecimal. New access tokens now contain only hexadecimal characters[0-9a-f], eliminating special characters such as=,+, and/when tokens are transmitted through cookies, HTTP headers, query parameters, or intermediate parsers. The token length has also increased from108to128characters. -
Improved Bearer token parsing
AccessTokens.extractBearerTokennow extracts a token only when the input starts with the standardBearerprefix. The previousindexOf("Bearer ")approach has been removed to prevent incorrectly parsing malformedAuthorizationheader values. -
Added Hexes utilityIntroduced the
Hexesutility withHexes.toLowercaseHex(byte[])andHexes.decodeLowercaseHex(String). The decoder validates both hexadecimal length and character validity, allowing invalid input to be detected early instead of producing unexpected results. -
Separated access token cleanup from AdminViews and WebViews
AdminViews.redirectToLoginandWebViews.redirectToLoginare now responsible only for redirect and login callback handling. Access token cleanup has been moved to dedicated HTTP response utilities, providing clearer separation of responsibilities and making the cleanup logic reusable across different authentication flows. -
Added HttpResponses utilities for clearing authentication cookiesAdded
HttpResponses.clearAdminAccessToken(HttpServletResponse)to removeadminAccessTokenandadminAccessTokenExpiredAt, andHttpResponses.clearUserAccessToken(HttpServletResponse)to removeaccessTokenandaccessTokenExpiredAt. Cleared cookies are configured with path/, max age0, and theHttpOnlyattribute. -
Improved authentication error handling for Admin
AdminGlobalExceptionHandlernow automatically clears the admin access token when an invalid token, an expired token, or anHttpUnauthorizedExceptionis encountered. This ensures stale authentication cookies are removed before redirecting users back to the login page or continuing error processing. -
Improved authentication error handling for Web
WebGlobalExceptionHandlernow clears the admin token whenever an admin token is invalid or expired, and clears the user token whenever a user token is invalid or expired. ForHttpUnauthorizedException, both user and admin authentication cookies are cleared before redirecting to the login page or returning an HTTP401 UnauthorizedAPI response. -
Compatibility noteExisting Base64-formatted access tokens are no longer valid after upgrading to this release. Administrators and users currently signed in with older tokens may need to sign in again to receive new lowercase hexadecimal access tokens.