Symfony3 HWIOAUTH捆绑认证成功处理程序

时间:2018-02-23 12:00:01

标签: php symfony hwioauthbundle

我已经使用FOSUserBundle和HWIOAUTH进行注册和登录。我有两种类型的寄存器和登录URL与查询参数和没有参数。如果Url登录并通过params注册,那么我想重定向到Payment Gateway。

是否有成功的处理程序事件?

我怎样才能做到这一点?提前谢谢。

security.yml

social:
        pattern: ^/            
        form_login:
            provider: fos_userbundle
            csrf_token_generator: security.csrf.token_manager
            login_path: fos_user_security_login
            check_path: fos_user_security_check
            default_target_path: user_bundle_homepage
            #use_forward:    false
            success_handler: my.authentication_success_handler
            #failure_handler: my.authentication_failure_handler
        oauth:
            resource_owners:
                facebook: "/login/check-facebook"
                google: "/login/check-google"
            login_path: fos_user_security_login
            failure_path: fos_user_security_check
            default_target_path: user_bundle_homepage
            oauth_user_provider:
                #this is my custom user provider, created from FOSUBUserProvider - will manage the
                #automatic user registration on your site, with data from the provider (facebook. google, etc.)
                service: my_user_provider
            success_handler: my.authentication_success_handler
        logout:
            path:   fos_user_security_logout
            target: fos_user_security_login
        anonymous: true`

1 个答案:

答案 0 :(得分:0)

您好,您可以使用覆盖FOS \ UserBundle \ Controller \ RegistrationController并在registerAction中插入您的逻辑。 https://symfony.com/doc/current/bundles/FOSUserBundle/overriding_controllers.html