This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

Manual Authentication in Forms app

Hi, All,
I have an application that is currently using the standard forms style login that Spring Security offers. A filter chain is set up that automatically redirects to a login page, etc.

I now have a need in this same application to manually authenticate a user into the system when provided a username and password through a separate means, like passed in the query string, read from a file, etc. My hope was to intercept the request in the LoginRedirectFilter, inject the credentials into the context, then manually kick off the same doAuthentication method that is used when the login screen posts. I want to go this route to make sure all of the authority information gets loaded up for the user correctly. Is that possible?

If anyone has any example code of how to do it I would be grateful...I'm a bit stumped.