Uploaded image for project: 'Spring BlazeDS Integration'
  1. Spring BlazeDS Integration
  2. FLEX-185

Set details on the new Authentication token before using it for authentication in SpringSecurityLoginCommand

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 1.5.0.M2
    • Fix Version/s: 1.5.0.RC1
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Any

      Description

      Having the details set on an Authentication object is a standard process in spring-security. This is something that the class which creates the AUthentication Token is responsible for.

      For example, in UsernamePasswordAuthenticationFilter:
      85: UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken(username, password);
      95: setDetails(request, authRequest);
      97: return this.getAuthenticationManager().authenticate(authRequest);
      This is done in three lines.

      But the current implementation of SpringSecurityLoginCommand simply creates the token and authenticates with it, it never sets the details:
      Authentication authentication = this.authManager.authenticate(new UsernamePasswordAuthenticationToken(username, extractPassword(credentials)));

      It would be nice if it could be enhanced like so to set a meaningful details object:
      protected AuthenticationDetailsSource authenticationDetailsSource = new WebAuthenticationDetailsSource();
      ...
      UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken(username, extractPassword(credentials));
      authRequest.setDetails(authenticationDetailsSource.buildDetails(request));
      Authentication authentication = getAuthManager().authenticate(authRequest);

        Activity

        Hide
        pulkitsinghal Pulkit Singhal added a comment -

        Thanks for fixing it.

        Show
        pulkitsinghal Pulkit Singhal added a comment - Thanks for fixing it.

          People

          • Assignee:
            jeremyg484 Jeremy Grelle
            Reporter:
            pulkitsinghal Pulkit Singhal
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1d
              1d
              Remaining:
              Remaining Estimate - 1d
              1d
              Logged:
              Time Spent - Not Specified
              Not Specified