Spring Security
  1. Spring Security
  2. SEC-1857

ContextPropagatingRemoteInvocation does not correctly propagate the principal

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.7
    • Fix Version/s: 3.0.8, 3.1.0
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Java 6.1; Spring 3.0.6; Spring Security 3.0.7

      Description

      ContextPropagatingRemoteInvocation was changed so that the principal and credentials were propagated via the toString method (see https://jira.springsource.org/browse/SEC-1741), as follows:

      principal = currentUser.getPrincipal().toString();
      credentials = currentUser.getCredentials().toString();

      However, this only works if the toString method actually returns the principals name and in the case of principal of type org.springframework.security.core.userdetails.User it returns a description of the User object, not the name.

      I suggest the solution is as follows (it works for me at least):

      principal = currentUser.getName();
      credentials = currentUser.getCredentials().toString();

      Any more info required just let me know.

        Activity

        Hide
        Luke Taylor added a comment -

        This seems like a good idea. I've made the suggested change.

        Show
        Luke Taylor added a comment - This seems like a good idea. I've made the suggested change.

          People

          • Assignee:
            Luke Taylor
            Reporter:
            Wayne Robinson
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: