I'm currently working on a RESTful API using the play! framework 2.x for an academic project.
I tried to use the Apache Oltu library but as they make intensive usage of HttpServletRequest/Response I wasn't able to use it. Then I found a play Request wrapper to HttpServletRequest but it was for play 1.x. Because I have no knowledge of servlets I wasn't able to write a wrapper by myself so I searched the web for something else.
I'm trying to use the oauth2play2scala library (which is a port of Oltu for play 2.x) to implement an OAuth provider, but I'm facing the problem that the library was written for the Scala API of play while I'm exclusively using Java.
As you can see in the example code from the oauth2play2scala repository, I need to pass the play.api.mvc.Request instance to the OAuthAuthzRequest constructor. All the classes in the play.api package are used in scala, while the classes out of this packages are usable in Java. In order to construct a OAuthAuthzRequest, I need:
- to retrieve the play.api.mvc.Request instance (from Scala to Java) OR
- to find a wrapper in order to use a play.mvc.Request (Java) as a play.api.mvc.Request (Scala)
- another alternative that I didn't thinked about :D
Thanks in advance