To answer your specific question, you can get the request (request) parameters by calling:
Controller.request().queryString()
Getting OAuth2 is easy, but not trivial. This helps to have a working pattern. I would recommend downloading Play1 and see a sample Facebook authentication. And then port the code to Play2. I did this and found the process very instructive. You will realize that every site and API has quirks / needs, so there is very little additional code that seems useful for one site for another.
A more phased answer is that there are several steps. First, you need to get access_token , and then you can use it. To get access_token , you need to send the user to the site authorization URL, so far it will be something like this:
https://graph.facebook.com/oauth/authorize/?client_id=idFromFacebook&redirect_uri=http://yourdomain.com/auth
As soon as your user accepts the authorization, the site will redirect the user with a code, something like http://yourdomain.com/auth?code=XYZ_ABC . Then you will need to request access to the url token from the sites to get the access token. For Facebook, it will be something like:
https:
The response from the above URL will contain access_token .
Now you can start using the access token to request information.
Vineet
source share