1

I have a project where I log in with the auth and from time to time it's an error and it is not possible to connect. And I would have something to show me this error, so I can do the treatment and return a message to the User.

When he does not connect it automaiticamente back to the root, and that this ta treaty on security:

oauth:
    resource_owners:
        facebook:   "/security/login/check-facebook"
        google:     "/security/login/check-google"
        linkedin:   "/security/login/check-linkedin"
    login_path: /
    failure_path: /
    default_target_path: /security/connected
    check_path: /security/login_check
    oauth_user_provider:
        service: web_key_user_provider

Mainly to get treatment when the authentication page facebook or google me return one bad_request = 400

as I would for the Routa to put in failure_path, to catch because it failed?

Marcius Leandro
  • 775
  • 1
  • 11
  • 34

1 Answers1

1

You have to implement an EventListener which is called when the onAuthenticationFailure event is fired, and set it as failure_handler in your HWIOAuth configuration.

See this great answer on another similar issue :

How to disable redirection after login_check in Symfony 2

Hopes this helps you.

Community
  • 1
  • 1
chalasr
  • 12,971
  • 4
  • 40
  • 82