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

REST authentication failed if unicode/utf8 login/password

    XMLWordPrintable

    Details

    • Sprint:
      Sprint 67 - Team Newton, Sprint 69 - Team Newton, AM Sustaining Sprint 21
    • Support Ticket IDs:

      Description

      Hi,

      REST authentication api with "X-OpenAM-Username" and "X-OpenAM-Password" headers doesn't work with login and/or password encoded in utf8.

      From RFC, headers values are encoded in ISO-8859-1 but it just bytes...

      curl cmd:

      curl --request POST --header "Content-Type: application/json" --header "X-OpenAM-Username: 測試測試測試測試" --header "X-OpenAM-Password: 測試測試測試測試" --data "{}" http://...../openam/json/authenticate

      give:

      {"code":401,"reason":"Unauthorized","message":"Authentication Failed!!"}

      expect:

      {"tokenId":"AQIC5wM2LY.......DE0Ng..*","successUrl":"/openam/console"}

      In "RestAuthNameCallbackHandler" and "RestAuthPasswordCallbackHandler", header value should be convert in unicode.

      Roughly example:

      String username = new String(((String)request.getHeader(USERNAME_HEADER_KEY)).getBytes("ISO-8859-1"), "UTF-8");

      String password = new String(((String)request.getHeader(PASSWORD_HEADER_KEY)).getBytes("ISO-8859-1"), "UTF-8");

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kamal.sivanandam@forgerock.com Kamal Sivanandam
                Reporter:
                gamaliel.sick@yahoo.fr gamaliel.sick@yahoo.fr [X] (Inactive)
                QA Assignee:
                Filip Kubáň
              • Votes:
                1 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 8h
                  8h
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 8h
                  8h