File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes Authenticating in Spring Security with password and username in url Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Authenticating in Spring Security with password and username in url" Watch "Authenticating in Spring Security with password and username in url" New topic
Author

Authenticating in Spring Security with password and username in url

Bartek Duda
Greenhorn

Joined: Jan 18, 2011
Posts: 3
I have application that use Sprin Security and runs on Tomcat. I need to allow user to authenticate only using link with password and username as parameters. I'm searching for any advice how to do that, possible solutions, etc.
Thanks for any help.
Vyas Sanzgiri
Ranch Hand

Joined: Jun 16, 2007
Posts: 686

I am no expert but I think you need to have a custom authentication processing filter and then generate unique url based on some combination of username and password.


===Vyas Sanzgiri===
My Blog
Bartek Duda
Greenhorn

Joined: Jan 18, 2011
Posts: 3
Thank you for replay,
I read some documentation and at that moment one possible solution to me is to write custom filter, something like that:


And register it:


But there are still many question to me:
1. How to "tell" that given user and password are correct and ther is no need to redirect to login page? How set Authentication obect?
2. Where put my filter? before="FIRST" or after="PRE_AUTH_FILTER" or somwhere else?
3. Is "extends OncePerRequestFilter" the best choice?

Any advice welcome :-)
Bartek Duda
Greenhorn

Joined: Jan 18, 2011
Posts: 3
I founded solution,
I added filter


And in configuration:



It works exactly as I wanted.
Regards
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Authenticating in Spring Security with password and username in url
 
Similar Threads
how to get input from javascript and pass to servlet
How to store userName and password in Database?
Java client accessing .net WS
How to store userName and password in Database?
UserName and Password for starting Websphere Application Server5.0