0

I'm working on a Symfony 2.4.4 project and I would like to secure an url through security.yml. Symfony default behaviour is to deny access and redirect to login but i would like to through an exception. Does any one know how should i accomplish it?

I'm talking about sonata login route /admin/login, I want to through an exception when unauthenticated users try to access.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
peris
  • 943
  • 3
  • 20
  • 33

1 Answers1

2

Take a look at Entry Point option in a firewal - http://symfony.com/doc/current/components/security/firewall.html#entry-points

This question/answer may have the information you need - What is the best way to notify a user after an access_control rule redirects?

Community
  • 1
  • 1
dmnptr
  • 4,258
  • 1
  • 20
  • 19
  • Thanks, i'm going to give it a try. I was thinking about using access_denied_handler which may also do the trick. Thanks again! – peris May 22 '14 at 13:44
  • According to this - http://stackoverflow.com/questions/11968354/symfony2-why-access-denied-handler-doesnt-work `access_denied_handler` may not be called every time. – dmnptr May 22 '14 at 16:51