0

I am building a new subproject in symfony2 with FOSUserBundle and FOSRestBundle. This subproject should be an backend for the complete project. I want to build another subproject, which consumes the api and build a front-end in desktop system browser. Another subproject will build front ends in html5 for tablet and smartphones. They will be packed with phonegap to act like native apps.

I am struggling around with stuff of User login an registration. I think about using oauth for this, so that Facebook, Google etc can be used for logging in an using it. Therefore the api will be protected with oauth. But how to build the rest api for registering and logging in? The other api functions the client consumes will have to pass user information so that the function can get access to user data, stored in the back end. Which bundles are available to use in this case? Are there some information how to build up such a system?

Daniel Pomrehn
  • 791
  • 3
  • 8
  • 23

1 Answers1

0

You have a bundle for Oauth : https://github.com/FriendsOfSymfony/FOSOAuthServerBundle

Clément Andraud
  • 9,103
  • 25
  • 80
  • 158
  • I didn't understand this bundle in complete. This will just do the login? And not the register of new users? I will integrate it in the api subproject? How do I do the login with a rest service? – Daniel Pomrehn Jul 23 '14 at 10:36
  • Register a user is with the fosuserundle. Oaauth is for login. You send for example username+password to the rest api, and if ok, you receive an access token. – Clément Andraud Jul 23 '14 at 12:15
  • I hoped that there will be an easy way to offer the registration via api call, too. Instead of using the default fosuser registration form. – Daniel Pomrehn Jul 23 '14 at 17:12
  • The easy way, build a route like POST /api/registration with RestBundle, build a registration form, send data to the form with json and, magic, you can register a user... – Clément Andraud Jul 24 '14 at 08:07