Uploaded image for project: 'Apache Oltu'
  1. Apache Oltu
  2. OLTU-103

POST method of TokenEndpoint not working on Glassfish 3.1.2

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • oauth2-0.31
    • None
    • None
    • Glassfish 3.1.2
      Apache Oltu from SVN trunk (0.31-SNAPSHOT, 2013-25-04)

    Description

      yThe POST method in the TokenEndpoint class in the integration tests package is defined as follows:

      @POST
      @Consumes("application/x-www-form-urlencoded")
      @Produces("application/json")
      public Response authorize(@Context HttpServletRequest request) throws OAuthSystemException

      Now, the annotation @Consumes("application/x-www-form-urlencoded") is used to get the body of the POST parsed into the parameters of HttpServletRequest request. Sadly this does not work on Glassfish.
      For similar problems see:

      What works is the following:

      @POST
      @Consumes("application/x-www-form-urlencoded")
      @Produces("application/json")
      public Response token(MultivaluedMap<String, String> params) throws OAuthSystemException

      Apache Oltu expects a HttpServletRequest to build a OAuthTokenRequest object out of it.
      To workaround the problem I made a wrapper class: https://gist.github.com/dschuermann/5509667

      I propose to allow other constructors with objects working in Glassfish. One could also report the bug upstream.

      Could be related:

      Attachments

        Activity

          People

            Unassigned Unassigned
            dschuermann Dominik Schürmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: