oltu-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominik Schürmann (JIRA) <j...@apache.org>
Subject [jira] [Updated] (OLTU-103) POST method of TokenEndpoint not working on Glassfish 3.1.2
Date Sun, 02 Jun 2013 23:59:20 GMT

     [ https://issues.apache.org/jira/browse/OLTU-103?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Dominik Schürmann updated OLTU-103:
-----------------------------------

    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:
 * http://jersey.576304.n2.nabble.com/Tomcat-Deployment-Vs-Jetty-Deployment-no-parameters-from-HttpServletRequest-td1516207.html
 * http://cxf.547215.n5.nabble.com/POST-data-missing-in-Context-td4391121.html
 * https://issues.apache.org/jira/browse/CXF-2993

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:
* https://java.net/jira/browse/JERSEY-188
* https://java.net/jira/browse/GLASSFISH-13204

  was:
The 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:
 * http://jersey.576304.n2.nabble.com/Tomcat-Deployment-Vs-Jetty-Deployment-no-parameters-from-HttpServletRequest-td1516207.html
 * http://cxf.547215.n5.nabble.com/POST-data-missing-in-Context-td4391121.html
 * https://issues.apache.org/jira/browse/CXF-2993

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:
* https://java.net/jira/browse/JERSEY-188
* https://java.net/jira/browse/GLASSFISH-13204

    
> POST method of TokenEndpoint not working on Glassfish 3.1.2
> -----------------------------------------------------------
>
>                 Key: OLTU-103
>                 URL: https://issues.apache.org/jira/browse/OLTU-103
>             Project: Apache Oltu
>          Issue Type: Bug
>          Components: oauth2-authzserver, oauth2-common, oauth2-integration-tests
>    Affects Versions: 0.31
>         Environment: Glassfish 3.1.2
> Apache Oltu from SVN trunk (0.31-SNAPSHOT, 2013-25-04)
>            Reporter: Dominik Schürmann
>
> 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:
>  * http://jersey.576304.n2.nabble.com/Tomcat-Deployment-Vs-Jetty-Deployment-no-parameters-from-HttpServletRequest-td1516207.html
>  * http://cxf.547215.n5.nabble.com/POST-data-missing-in-Context-td4391121.html
>  * https://issues.apache.org/jira/browse/CXF-2993
> 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:
> * https://java.net/jira/browse/JERSEY-188
> * https://java.net/jira/browse/GLASSFISH-13204

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message