I'm learning Angularjs to create a single page application for a new project. The back-end will be in Scala with Play 2.0 framework in a REST style API. I would like to use FB, Twitter, Google, OpenId accounts has a way for the users to register and log in, but I don't know a lot about OAuth and how to make it work with Angular and Play 2.0 (of course I have started to read on OAuth).
Do you have any ideas of how to achieve that? Are there any libraties/tools to handle it? Or tutorial and examples?
EDIT: As pointed by Pere Villega, SecureSocial seems a good options on the Play side, but it is follow a MVC pattern (view generated on the server) as opposed to angularjs + play which is more MVP (or MVVM) + REST api on the server. For Angular I found Sapling. I have to figure out how to integrate the 2.
Use Secure Social. Best invention since sliced bread. True story ;)
Have a look at http://www.espeo.pl/2012/02/26/authentication-in-angularjs-application
It shows you how to deal with accessing secured resources from an Angular perspective, all triggered from the client side. I think you could use Secure Social on the server with all of your REST API's behind SecureAction
actions in the Play! controller.
I need to do something similar, but for now I'll use LDAP since it's a corporate application I'm building. Maybe I'll look at contributing LDAP/AD to Secure Social.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With