symfony中hwi_oauth的治疗途径

时间:2016-02-03 17:39:58

标签: symfony routes hwioauthbundle

我有一个项目,我使用auth登录,有时它是一个错误,无法连接。我会告诉我这个错误,所以我可以进行处理并向用户返回一条消息。

当他没有将自动化连接回根时,以及这个关于安全性的条约:

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

主要是在认证页面facebook或google me时返回一个bad_request = 400

进行处理

正如我想让Routa放入failure_path,因为它失败而被捕?

1 个答案:

答案 0 :(得分:1)

您必须实现在EventListener事件触发时调用的onAuthenticationFailure,并在HWIOAuth配置中将其设置为failure_handler

在另一个类似的问题上看到这个好的答案:

How to disable redirection after login_check in Symfony 2

希望这会对你有所帮助。