Uploaded image for project: 'OpenAM'
  1. OpenAM
  2. OPENAM-15687

Session endpoint is searching for a long value in CTS that is stored as a string

    Details

    • Sprint:
      AM Sustaining Sprint 70
    • Story Points:
      2
    • Support Ticket IDs:
    • Needs QA verification:
      No
    • Functional tests:
      No
    • Are the reproduction steps defined?:
      Yes and I used the same an in the description, Yes but I used my own steps. (If so, please add them in a new comment)

      Description

      Bug description

      When using amster to query sessions, Amster makes a a REST call to the sessions endpoint to iterate through CTS sessions.  The CTS entries of type OAUTH2_STATELESS_GRANT have the oauth2 client_id as the value of coreTokenString04.   When looking at this attribute, AM is trying to parse out a long value from an attribute that is stored as string causing a NumberFormatException.

      How to reproduce the issue

       

      1. Create Oauth2 client
      2. Run Amster command query Sessions --realm / --filter 'realm eq "/"'
      3. Observe error "{"code":400,"reason":"Bad Request","message":"For input string: \"test-client\""}"
      Expected behaviour
      sessions should be returned with no error
      
      Current behaviour
      400 bad request is returned
      

       

      Code analysis

       

      CtsPartialSessionsFactory.java
      } else if (field.equals(SessionTokenField.LATEST_ACCESS_TIME.getField())) {
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                lawrence.yarham Lawrence Yarham
                Reporter:
                abel.hoxeng Abel Hoxeng
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: