Results 1 to 4 of 4

Thread: Encorporating Custom UserDetails

  1. #1

    Default Encorporating Custom UserDetails

    Hi

    I cannot find anywhere in the docs or this forum where it is possible to either a) add properties to UserDetails or b) (what I really want todo) use my own customer User object?

    I know it is possible but how to you encorporate your own User object? I can no doubt do it by overriding existing providers/filters, but is there a cleaner / easier way?

    Any help would be appreciated..

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

    Default

    Nearly every deployment of Acegi Security will use DaoAuthenticationProvider, which needs an AuthenticationDao, and most people write their own AuthenticationDao. The AuthenticationDao needs to return a UserDetails implementation. Generally people return either User (which implements UserDetails) or a subclass of User, although naturally you're free to write your own UserDetails implementation.

  3. #3

    Default UserDetails

    ok thanks,

    I thought they maybe a:

    <param>userclass</param>
    <value>my.com.UserDetails</value>

    type thing for the Authenticator that would allow me to pass in my custom class, and then the authenticator use that (using reflection)..

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

    Default

    Say the AuthenticationProvider created an instance of the class you specified, what would then populate it?

    Using the UserDetails approach will make the UserDetails object available from Authentication.getPrincipal().

Similar Threads

  1. Replies: 2
    Last Post: Sep 1st, 2009, 09:24 AM
  2. Replies: 2
    Last Post: Aug 2nd, 2006, 10:18 PM
  3. Replies: 3
    Last Post: Nov 15th, 2005, 03:24 PM
  4. Replies: 3
    Last Post: Oct 8th, 2005, 04:05 AM
  5. custom UserDetails and User
    By phil.fuse in forum Security
    Replies: 3
    Last Post: Jun 30th, 2005, 04:49 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
  •