Results 1 to 8 of 8

Thread: Different Logins, different login forms

  1. #1
    Join Date
    Feb 2005
    Posts
    3

    Default Different Logins, different login forms

    I've got this webapp that has 2 different entry points:
    - login 1 requires account id, username and password
    - login 2 requires only username and password

    What would I have to do to get this done?

  2. #2
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    Are all users coming from the same AuthenticationProvider (ie backend database)?

    This thread might give some ideas on how multiple authentication tokens can be used: http://forum.springframework.org/viewtopic.php?t=284.

    This thread might give some ideas on chaining authentication providers (basically you probably want to do that): http://forum.springframework.org/viewtopic.php?t=2729.

  3. #3
    Join Date
    Feb 2005
    Posts
    2

    Default

    I have same kind of situtation.

    - two restricted ares and a public area
    www.myapp.com
    www.myapp.com/users/
    www.myapp.com/admin/

    - two entry points to the restricted areas and two error pages

    www.myapp.com/login.jsp
    www.myapp.com/loginerror.jsp
    www.myapp.com/login2.jsp
    www.myapp.com/loginerror2.jsp

    - two database tables where user information is stored

    I could find instructions how to write custom code to authenticate but still have problems to define two entry points & error pages ???

    How this can be achieved?

  4. #4
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    Is it really necessary to have this level of complexity in your app? Surely it would be easier to have a consolidated login page, and login error page, and a single AuthenticationEntryPoint. A delegating/custom AuthenticationDao or AuthenticationManager can be used to successively poll different backends until the user is located. Is the use of two login pages a symptom of having two different databases - does it really need to be preserved?

  5. #5
    Join Date
    Feb 2005
    Posts
    2

    Default

    Using two different databases is a customer requirement.

    Is it possible to forward client based on the role? If I would use
    single login page www.myapp.com/login.jsp can I do something
    like:

    * if role == admin -> www.myapp.com/admin/
    * if role == user -> www.myapp.com/user/

    ???

  6. #6
    Join Date
    Feb 2005
    Posts
    3

    Default

    So does that mean if there are different logins it should be different webapps altogether?

  7. #7
    Join Date
    Feb 2005
    Posts
    2

    Default

    Quote Originally Posted by igeca
    Using two different databases is a customer requirement.

    Is it possible to forward client based on the role? If I would use
    single login page www.myapp.com/login.jsp can I do something
    like:

    * if role == admin -> www.myapp.com/admin/
    * if role == user -> www.myapp.com/user/
    Yes, this is possible. For example you can read the session variable defined by ACEGI_SECURITY_AUTHENTICATION_KEY to get the role and use it in your controller (depending on the framework you are using) to forward to the desired location.

    Philipp

  8. #8
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    You should use the ContextHolder to obtain the current Authentication - never use HttpSession. Indeed the ACEGI_SECURITY_AUTHENTICATION_KEY attribute is removed in version 0.8.0 (coming soon) and replaced with storage of the Context as a whole.

    Regarding forwarding, if it's just a case of having a single login page but a different "login success" page, you could use the AbstractProcessingFilter.alwaysUseDefaultTargetUrl to redirect to a standard JSP which then uses the Acegi Security authz taglib to do the redirection based on role held by the user.

Similar Threads

  1. acegi + CAS going in loop after login
    By mcecca in forum Security
    Replies: 3
    Last Post: Sep 30th, 2005, 02:56 PM
  2. how to config two login entry point?
    By creatxr in forum Security
    Replies: 3
    Last Post: Apr 11th, 2005, 11:32 PM
  3. Replies: 1
    Last Post: Feb 25th, 2005, 07:12 AM
  4. Forms and nested properties
    By DaGGeRRz in forum Swing
    Replies: 0
    Last Post: Feb 23rd, 2005, 08:59 AM
  5. Acegi - Login Tapestry
    By john017 in forum Security
    Replies: 1
    Last Post: Feb 4th, 2005, 01:11 AM

Posting Permissions

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