is there a way in symfony2 to authenticate user for dynamic path ?
For example if i have a firewall like this:
main:
pattern: ^/
and after login user path looks like this /someSlug/...
is there a way to authenticate them only for that pattern? so multiple users can be loggedin ? Normally if i would know the slugs i would set up multiple firewalls
main1:
pattern: ^/slug1/
main2:
pattern: ^/slug2/
and it's done, but i need it dynamically because i don't know how much slugs there is gona be and what they are.
Any ideas ?
Out-of-box, I suspect probably not.
If this is administrative work you should be use to use Use impersanation.
http://symfony.com/doc/current/cookbook/security/impersonating_user.html
If this is a general purpose use for this (other than administrative) you should be probably able to set kernel request listener that will listen for each request, parse out the given slug
and set set User
object in session. That object is to be used by controllers and templates.
What do you think?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With