2015-07-20 42 views
0

後,我不知道是否有把連propio security.yml文件,就像一個辦法:重定向被記錄

web: 
     pattern: ^/web 
     oauth: 
      resource_owners: 
       facebook: "/web/login/check-facebook" 
       google:  "/web/login/check-google" 
       linkedin: "/web/login/check-linkedin" 
      login_path:/
      failure_path:/
      default_target_path:/
      check_path: /web/login_check 

同樣具有login_path:/有事情login_sucess_path?

回答

1
hwi_oauth_connect_service: 
    pattern: /service/{service} 
    defaults: { _controller: DelivveWebBundle:Default:connectService} 

目前我改寫了這條路線

,我有下面的方法在我的控制器

public function connectServiceAction() #(Request $request, $service) 
    { 
     $user = $this->container->get('security.context')->getToken()->getUser(); 
     return $this->container->get('templating')->renderResponse('default/index.html.twig'); 

    } 
0

閱讀the documentation

從線128開始就給出了重定向的參數登錄,即後:

# login success redirecting options (read further below) 
always_use_default_target_path: false 
default_target_path:   /
target_path_parameter:   _target_path 
use_referer:     false 

# login failure redirecting options (read further below) 
failure_path: /foo 
failure_forward: false 
failure_path_parameter: _failure_path 
failure_handler: some.service.id 
success_handler: some.service.id 

所以,是的,它確實有類似的東西來login_success_path,即default_target_path

+0

然後我看到了一些東西,但在我看來,它更當我使用窗體,在我的情況下,我有一個鏈接,我讓我去控制器請求捆綁 –