Results 1 to 3 of 3

Thread: How to perform pre login tasks

  1. #1
    Join Date
    Jun 2010
    Posts
    1

    Red face How to perform pre login tasks

    Hi,

    I am pretty new to spring.
    I have requirement of performing db existence check before redirecting the user to the login page.

    use case :
    1. User enters loginpage url.
    2. Check if db is present.
    3. if yes redirect user to login page(A).
    4. if no redirect user to required page(B).

    Present implementation: This check was achieved by making an ajax call in page A's Post method, to a service which is exposed by security for non authenticated users.On success redirect the user to page A else to page B.

    Problem is i feel this is not the correct way to implement Pre-Login events.

    I tried using pre authentication filter but am not able to achieve this case since pre-auth filter directly gives login page first and does the processing next.
    I do not want the user to see the login page before the pre-conditions are met.

    am i implementing this in the correct way, are there any other options on which i can relay on.

  2. #2
    Join Date
    Mar 2010
    Location
    Boston, MA
    Posts
    316

    Default

    How about implementing a custom filter which fires before the spring security filters?

  3. #3
    Join Date
    Sep 2004
    Location
    Manchester, NH
    Posts
    1,236

    Default

    Yes, it sounds like you don't even need Spring Security for this. Just plunk a servlet filter before any security stuff in the web app configuration.
    Peter Mularien | Blog
    Author, Spring Security 3 (Book) - Packt Publishing, Available in print and eBook form
    SCJP 5, Oracle DBA
    Any postings are my own opinion, and should not be attributed to my employer or clients.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •