Announcement Announcement Module
No announcement yet.
SpringRCP: how to get principal on the server side? Page Title Module
Move Remove Collapse
This topic is closed
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • SpringRCP: how to get principal on the server side?

    I am trying to get principal on the server side of Spring RC petclinic, but ContextHolder.getContext() is null.

    (SecureContext)ContextHolder.getContext()).getAuth entication().getPrincipal() )

    Any help on this?

    Thank you

  • #2
    Should user name and password be passed on every request from the client, if yes, what about session id, could session id be related to client's passed credentials upon login? I noticed that user and password are just passed for login screen and not on subsequent requests from client.


    • #3
      Generally with BASIC and Digest authentication you would avoid using HttpSessions. Passing a jsessionid or cookie to facilitate servlet container sessions is something your remoting protocol would need to do - Acegi Security doesn't offer a mechanism to do this, although the HttpInvoker method would facilitate this if you wanted to pursue it.


      • #4
        So I guess the problem with the SpringRCP petclinic sample app is that client not passing user and password on every request? (ContextHolder.getContext() is empty on server side)

        And by the way I did tracing on the client server communication and noticed that jsessionid is present in the HTTP header.


        • #5
          Or possibly the server-side is not configured to process BASIC authentication headers. See the Contacts Sample (Filters version) for the correct configuration. I am unsure of the status of Petclinic RCP and why it doesn't work correctly, as I haven't had time to review it. Promise to do so soon! I've added it to JIRA: