api - Symfony2 How to authenticate an user on two different firewall with two different method? -
i have 2 firewalls, 1 api calls (wsse secured), 1 application. both works well, need authenticate user on api firewall , in same time on application firewall , can't that.
my security.yml
firewalls: # firewall api wsse_secured: pattern: ^/api/.* wsse: nonce_dir: null lifetime: 300 provider: fos_userbundle context: user # firewall application main: pattern: /.* form_login: provider: fos_userbundle login_path: fos_user_security_login check_path: fos_user_security_check default_target_path: espace_perso always_use_default_target_path: false failure_path: fos_user_security_login logout: path: fos_user_security_logout target: fos_user_security_login oauth: resource_owners: facebook: "/login/check-facebook" linkedin: "/login/check-linkedin" google: "/login/check-google" login_path: fos_user_security_login oauth_user_provider: service: bg.oauth.user_provider anonymous: true context: user
i read other post (this question, this one , this one) , can see, add context don't work in case.
i try add manually wsse header need, or create new wssetoken user events, without success.
i need problem must common...
as understand, want reuse action in api accessible user. if not, please give more details.
best thing make route same action, under different firewall.
assuming have:
<route id="api_form_validate" pattern="/api/validate-form"> <default key="_controller">bundle:apicontroller:validateform</default> </route>
add:
<route id="user_form_validate" pattern="/user/validate-form"> <default key="_controller">bundle:apicontroller:validateform</default> </route>
and change form action api_form_validate
user_form_validate
.
Comments
Post a Comment