php - Whats the best / recommended way to authenticate users using rest in Symfony? -


i developing rest apis in symfony application.

right apis used application on frontend (ajax requests angularjs). in future expose same apis third party applications well.

also having have android, iphone apps etc in future.

i have integrated fosoauthserverbundle, , have tried grant type workflows. working. confused can these used application or 3rd party applications integrate application ?

i understand how these workflow can used 3rd party apps. can't understand how can authenticate native application users ?

i want know how use bundle authenticate users on website through rest apis frontend app ?

currently usnig fosuserbundle , form_long authenticate user changing frontend use angularjs , rest based. ideally authentication should work form_login authentication should rest based.

i did research on , people suggest use "resource owner password credentials" needs client secret exposed in javascript may not secure

it should work e.g. user submits username/password credentials works in case of form_login instead of redirecting should return access_token.

do need write custome authentication provider uses usernamepasswordtoken , firewall listener oauthlistener returns access_token ? secure use?

the similiar question discussion here: symfony2 fosoauthserverbundle grant type password requires client secret

if don't want expose secret, use proxy beetween front-end angular code , actual oauth server. anyway, if expose secret still needs user credentials.

you can set allowed grant types each oauth client, in case create mobile apps, you'll want generate separate pair of client_id & client_secret app , front-end, allowed grant type of "password" front-end app.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -