Spring Security pass URL parameters to Authentication Provider
authentication, java, spring, spring-security
Solution
You could inject the HttpServletRequest object on your authentication provider class:
private @Autowired HttpServletRequest request;
Now, you should be able to access the request parameters with APIs such as `request.getParameterValues(paramName)`
Problem
Is there a way to pass URL parameters to an authentication provider in Spring Security 3? Our login page will need to receive an email token as a parameter that the authentication system will need to be aware of when it sets the status of the user. Specifically, it will let a user with a correct token log in that would not otherwise be able to. I have a custom class extending the DaoAuthenticationProvider class. My authentication logic is in that class's authenticate method. I'm hoping there is some way to pass this data into the authenticate method.