Suggestions on how to implement user authentication with PHP as a backend

@ankurk The issue right now is not “if” it is possible to write a backend in PHP, but more a matter of what you can handle in your timeframe. For PHP right now there are MANY frameworks that allow you to build a REST API. Many of the more modern frameworks have REST functionality pre-baked like (Some WAY easier than others):

There are plenty of others as well (there are more PHP frameworks I know of than I can name stars in the sky). That being said if you are going to take the time to learn REST, Ember, and a PHP backend I would stay clear of Code Igniter myself (I won’t derail this thread with my rantings), any of these others should be able to work for an Ember application.

If you are willing to reach out a bit, the Node framework @tarasm mentioned looks pretty easy, also you will find a lot of support from the Ember community for Rails (Rails) as well as Django (Python). Neither of these frameworks are particularly hard to learn either.

Keep in mind if you intend to use Ember Data you will need to have a fairly intimate understanding of the way IT uses REST. This is most likely NOT the way your framework will implement REST out of the box. Or else you will be in for a world of hurt trying to debug not only your Ember app but also your REST server as well. As such, you may want to avoid Ember Data right now (at least till it hits 1.0)

Your REST backend could be written in anything (I’ve personally seen Java, Ruby, Python) that can implement a REST strategy.

Best of luck, I hope this wall of text is not too long.

PS for full disclosure: the articles I linked are not vetted by me, I just found them on a quick google search. The only REST implementation I have done in PHP was in Symfony2, and I found it a bit lacking using the FOSRestBundle.

If hadn’t any time issues, believe me I would have preferred Node.js but at this point I can’t afford to waste my precious time on learning something new (I don’t want to sound rude).

Don’t worry, I take no offense. Only you can choose, but you won’t find a lot of Ember developers using a PHP backend yet so finding help may be an issue you want to weigh as well. Ultimately, if you do use PHP, I’d love to hear about your problems/successes when you finish up.

I know it’s a sort of a challenge but what’s a project without challenges? At the end of this project, I hope I will something to blog about. fingers crossed

I’m mostly a PHP developer and what you say is true.

I’m reading a lot of stuff about Ember: guides, tutorials, github projects, etc. and using a PHP backend is very uncommon. There are lot of Ember libraries for Rails, Node.js and so on but just a few for PHP.

For myself I’m using ToroPHP to deal with RESTful routes and Zend Framework to work with the database (I only use the Autoloader and Db classes and some other functions instead of using the full stack).

I’d be glad to hear about your progress and it’s not a bad idea to blog about the process.

PS: as always say, sorry my english I’m not, a native speaker

Well, I simply used Ajax calls to the Controller in the backend (I was using Codeigniter, might switch to Laravel, since it’s not in active development anymore). I actually want to know the reason behind why almost Ember devs use Rails as backend. I know Ember is quite close to Rails in design principles but still.

If you’d like to try a simple PHP framework which can provide a ReST interface you could check out the Fat-Free Framework’s routing system.

Nice! I didn’t know it. Thanks.