ok.
lets say I have a secure url pattern
/secure/link-profile
optionally, there can be url paramaters appended.
/se
See the method buildRedirectUrlToLoginPage(HttpServletRequest request, ...) in LoginUrlAuthenticationEntryPoint.
If I understood correctly what you want to achieve, I think it should be enough to override this method in a sublclass, copy the original method, but additionally call
urlBuilder.setQuery(request.getQueryString()) when it builds the url.
Then you only need to configure the ExceptionTranslationFilter with this customized entry point.