How Playframework Scala Facebook or other social media authorization - facebook

I'm trying to make a prototype web service. I'm using Play framework 2.3.8, Scala 2.11. I would like to implement user sign-in by using Facebook or any other social media service. I'm trying to find an online tutorial or any blog which explains how to do this. All I find is Play and Java related. Nothing about Scala. Could you please share some link how where to read about about it?

I had written one with Java and Spring, might be it will help you. Here is the link for the same : Facebook Graph API implementation

You could take a look at securesocial or play-silhouette.
Personally I only have experience with securesocial, together with Play 2.2. The master branch (upcoming Securesocial 3.0 release) supports Play 2.3, though you will probably need to browse the Google Group to find the necessary information to set it up.

Related

Play Framework 2.3 OAUTH 2 Java Provider

I know that it might be an old question, But I didn't find a solution for it. I need an Oauth2 Provider (not client) to secure my APIs that works on play framework java (not scala). I think this is important, any one reached for a solution for that.
The master branch of securesocial have support for play 2.3. Here is the project website: http://securesocial.ws/ . There isn't a stable version right now.

play framework app authentication, user management

Following the Book App example in play 2 for scala, I now have a basic working app.
What I want now is to add some features like
User registration
User authenetication to access some pages
What is the best way to do it in play for scala? Should I manage it by my own? is there a plugin for that?
Note: I'm the maintainer of Silhouette.
I can suggest you Silhouette which is a core only fork of Secure Social with the intention to built a more customizable, non-blocking and well tested implementation.
For the first stable version there are only two open issues which must be resolved. And these issues are only future requests. There are no API changes planed. The documentation must be improved and a sample application is started. The unit tests are also a good starting point.
If you plan to follow the authentication flow as stated by Secure Social then stick with it. It exists since more than two years and it is well tested by many companies. Otherwise take a look at Silhouette.
You have two options:
Secure Social (http://securesocial.ws/)
But it has unusual registration flow, where the user have to enter your email first, and receive link to registration form.
However, there is a pull request that address this issue (https://github.com/jaliss/securesocial/pull/260)
Play Authenticate
It doesn't support Scala out of the box. But there is a workaround created by me here: https://github.com/joscha/play-authenticate/issues/92
Both of them requires you to write the interface layer to database. An important drawback in both of them, is that you won't be able to make use of reactive database drivers like Reactive Mongo. they assume that you will return the results immediately, not a Future of the result.
There is a securesocial plugin (http://securesocial.ws). Covers most common authentication methods, has registration stuff. I found it very usefull.
The drawback is it's documentation. If you want to do something a bit differ from the simplest scenarios - be prepared to read through the source code.

Firebase and Play Framework (Scala) is it possible?

Hey I love Play Framework Scala and I also am falling in love with Firebase. I was wondering though, I'm planning on building an app using AngularFire and I'm going to need to do some server-side logic/computation and make some server-side queries to Firebase. Is this possible to do with a Play Framework Scala setup? If so what is the recommended approach? If not, is it coming? If so when? I think it's so cool that the Firebase guys used Scala to build Firebase, but I'm bummed there is no Scala API to work with (that I can see). Maybe I could use the Java API somehow, but write still write the app in Scala? Any help would be great. Thanks!
Scala is highly interoperable with Java (compiles to the same bytecode) so you should be able to use the Java API straight-up without any issues.
While some libraries add Scala-specific wrappers to make an API more idiomatic and pleasant for a functional programming style and to smooth some rough edges, it's often not strictly necessary.
If for some reason you didn't want to use the Java client libs, you could also interface with the Firebase REST API via Play 2's very convenience and succinct web services library.
Should be no problem with either their Java SDK (when using Firebase on the backend) or the JavaScript SDK (when using it on the client). But you won't have native support for Scala or Play, especially no support for Iteratee/Enumeratee in Play.
The Java API looks quite good and seems to be event driven. So it should be no problem to integrate it in Play in a scalable way.

Adding OAuth to a Scalatra web service

I am looking to build a Scalatra based API. One of the requirements is OAuth authentication. I noticed the guide for OAuth isn't yet put up on the official Scalatra site. Is the best way to currently add OAuth support by figuring out how to add an OAuth based strategy into Warden? I come from a Ruby on Rails based background, so new to a lot of Scala/Java conventions. There's probably several ways to tackle this but I'm hoping for any solution that's documented and can be referenced for implementation in my own application.
I am currently rewriting a Ruby/Sinatra app in Scala/Scalatra. I found the easiest way to add OAuth is to use Scribe (https://github.com/fernandezpablo85/scribe-java). There is a guide on using Scribe with Scala here:
https://github.com/earldouglas/nuevos#consuming-the-twitter-api-in-scala-with-scribe
Note that the exact implementation of the Twitter API is outdated. He made some minor updates to the code without actually updating the README (That confused me for some time.) I suggest you read the normal Java Scribe guide first, then take a look at the source code of the Scalatra example.

What is the GwtDocumentBridge mentioned in the realtime drive docs?

The API docs give a tantalizing hint of GWT bindings for the realtime service, but I can't find other mention of them.
Parameters:
gapi.drive.realtime.GwtDocumentBridge bridge — The driver for the GWT collaborative libraries.
I'm in the process of writing a GWT app with the realtime API and there's a bunch of complex plumbing that would be great to avoid! Is this GWT collaborative libraries reference to something that is already out there?
Sorry, but that is just an implementation detail. There is not a GWT API available at this time, just the javascript one.