Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Authentication via rest with symfony2

I'm new with symfony2 and i am trying to connect with FOSUserBundle via a rest api. The web browser authentication is working fine and I can create users with FOSUserBundle. In fact I want to build a webservice with Symfony. How can I connect a user vie rest ? Is it a bundle to use rest with symfony2 easily?

Thanks.

like image 702
Gp2mv3 Avatar asked Jan 15 '12 20:01

Gp2mv3


People also ask

How do I authenticate a user in REST web services?

Use of basic authentication is specified as follows: The string "Basic " is added to the Authorization header of the request. The username and password are combined into a string with the format "username:password", which is then base64 encoded and added to the Authorization header of the request.

How does REST API authentication work?

Users of the REST API can authenticate by providing a user ID and password to the REST API login resource with the HTTP POST method. An LTPA token is generated that enables the user to authenticate future requests. This LTPA token has the prefix LtpaToken2 .


1 Answers

I would suggest using "Wsse" as authorization method.

You can read about that at this post. There is even a bundle that provide wsse routines.

About make REST-ful your app, i would suggest using FosRestBundle

like image 100
rollsappletree Avatar answered Oct 20 '22 00:10

rollsappletree