Results 1 to 3 of 3

Thread: Can't receive custom UserDetails impl with RemoteAuthenticationManagerImpl

  1. #1
    Join Date
    Jul 2005
    Posts
    5

    Default Can't receive custom UserDetails impl with RemoteAuthenticationManagerImpl

    I'm working on client-server app with swing ui, and use Spring Remoting and Acegi. On the client side I do the following to authenticate user:
    Code:
    UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(userName, password);
    Authentication populatedAuthentication = authManager.authenticate(authentication);
    SecurityContextHolder.getContext().setAuthentication(populatedAuthentication);
    When I use
    Code:
    UserVo principal = (UserVo) securityContext.getAuthentication().getPrincipal();
    I receive String with user's name instead of my implementation of UserDetails. But when I start my app locally (without Spring remoting, RemoteAuthenticationManagerImpl, etc) it works fine, i.e. returns UserDetails implementation.

    Is this is limitation of HttpSessionContextIntegrationFilter, or I'm doing something wrong?

  2. #2
    Join Date
    Jul 2005
    Posts
    5

    Default

    Sorry, I've missed following notes in org.acegisecurity.providers.rcp.RemoteAuthenticati onManager javadoc:
    In order to maximise remoting protocol compatibility, a design decision was taken to operate with minimal arguments and return only the minimal amount information required for remote clients to enable/disable relevant user interface commands etc.
    So, if you use RemoteAuthenticationManager you can't get your UserDetails implementation on the client side, only array of GrantedAuthority.

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

    Default

    If remoting protocols offered better serialization support it would be easier. If you have a fairly good serialization-based remoting protocol, you could replace the RemoteAuthenticationManager implementation to return UserDetails instead of GrantedAuthority[].
    Ben Alex
    Project Founder, Spring UAA, Spring Roo and Spring Security

Posting Permissions

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