我想知道是否有办法放置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:/有什么东西登录_sucess_path?
答案 0 :(得分: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');
}
答案 1 :(得分: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
。