rest - Symfony2.8 API + Login Form -


i have website uses symfony2.8; working on mobile app use same project backend need support token based authentication regular login forms. resources i've found talk api authentication not api(token based) , form. has ideas how accomplish this?

i using fosuserbundle if matters.

you can using custom authenticators each case.

symfony 2.8 introduced guard, makes it's relatively easy create custom authenticators.

basically create 2 custom authenticators , means creating 2 services.

  1. formloginauthenticator -> app.form_login_authenticator
  2. apitokenauthenticator -> app.api_token_authenticator

once these services created, have register authenticators

in app/config/security.yml

security: ... main: anonymous: ~ knpu_guard: authenticators: - app.form_login_authenticator - app.api_token_authenticator entry_point: app.form_login_authenticator

obviously it's upto implement services, symfony docs provide decent starting point start .

check these links same :


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -