• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Authenticating in Spring Security with password and username in url

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 686
Netbeans IDE Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartek Duda
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I founded solution,
I added filter


And in configuration:



It works exactly as I wanted.
Regards
 
That is a really big piece of pie for such a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic