Results 1 to 4 of 4

Thread: Remember-Me with custom LDAP Authentication

Hybrid View

  1. #1
    Join Date
    Aug 2008
    Location
    India
    Posts
    23

    Question Remember-Me with custom LDAP Authentication

    Hi,
    I want to implement remember me functionality of spring security in my project. As of now, i've three input box on login screen:
    1. User Name
    2. Password
    3. Role
    I've custom ProcessingFilter, AuthenticationToken & AuthenticationProvider. AuthenticationProvider authenticates user request (taking all 3 input parameters) against LDAP with the help of spring-ldap. Once authenticated i fetch user roles from database (as user can be associated with more than one role) and populate it in UsernamePasswordAuthenticationToken which will be returned back from authenticate method of AuthenticationProvider.

    Now i want to add one checkbox on login screen, when checked, application should remember user for next 2 weeks.

    Any pointer for good documentation/tutorial??
    Is there any sample code available?

    Thanks.

  2. #2
    Join Date
    Aug 2008
    Location
    India
    Posts
    23

    Question

    I searched through different forums but didn't find any solution.
    Am i the only one facing this issue? i've seen similar posts, but without any resolution.

  3. #3
    Join Date
    Apr 2009
    Posts
    4

    Question

    Am somehow able to implement this. But the only problem i'm facing is with 'password'.

    When cookie is created it uses password entered by user to create cookie.
    And while authenticate against remember me service, it tries to fetch password from LDAP. But LDAP always return null for userpassword and hence it asks user to login again.

    Any Solution??

    For now, i changed TokenBasedRememberMeServices and used 'xyz' as password to create cookie and am using same 'xyz' in MyAppLdapUserDetailsService to return UserDetails object. It's working but not sure if it's safe/adviceable.

    Any suggestion?
    !Bhavesh

  4. #4
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    No, using a fixed password isn't a good idea.

    You can use PersistentTokenBasedRememberMeServices as an alternative implementation.
    Spring - by Pivotal
    twitter @tekul

Tags for this Thread

Posting Permissions

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