Using server-side php to authenticate javascript calls

I'm using a Symfony2 backend and AngularJS frontend in one project. Symfony is used to show the initial view and provide a RESTful API with AngularJS embedded into the view.

Basically AngularJS will be used for the frontend (view) and calling Symfony API to interface with the database (model).

I have a bunch of Angular http gets and posts which exposes the URL to my API . What would be the best way to secure the API in my scenerio?

I do have access to server-side with Angular but how do I pass that authentication from Symfony to Angular?

Thanks for the help.

This is a common need, and there are several approaches - but they usually settle on using sessions.

You might find this article to be a good overview of an AngularJS-specific implementation...

http://www.espeo.pl/2012/02/26/authentication-in-angularjs-application