[ https://issues.apache.org/jira/browse/OLTU-103?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Antonio Sanso resolved OLTU-103. -------------------------------- Resolution: Duplicate > 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: oauth2-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 was sent by Atlassian JIRA (v6.3.4#6332)