简体   繁体   English

经过验证的Symfony项目“主页”?

[英]Symfony project “homepage” after authenticating?

I have to make modifications on a Symfony project and I am looking where it is defined that a certain page shows up after authenticating. 我必须在Symfony项目上进行修改,并且正在寻找在身份验证后显示特定页面的定义位置。 The user logs with a ldap security that is defined in the security yml file, but I can't find anywhere where the homepage is listed. 用户使用yap安全性yml文件中定义的ldap安全性进行登录,但是在列出主页的任何地方都找不到。 I know if a user wants to access a certain page and is not authenticated, he will login and then be redirected to this page, but my question is if he passes though the login page first. 我知道用户是否要访问某个页面且未通过身份验证,他将登录然后重定向到该页面,但是我的问题是他是否首先通过了登录页面。

This behaviour is set in the security.yml file under the default_target_path option for the firewall being used. 在正在使用的防火墙的default_target_path选项下的security.yml文件中设置此行为。 The default value for this is just / which is the behaviour you're getting. 其默认值是/,这就是您得到的行为。 See the docs for all default security.yml options: http://symfony.com/doc/current/reference/configuration/security.html 有关所有默认security.yml选项的信息,请参阅文档: http : //symfony.com/doc/current/reference/configuration/security.html

If you want to set a different login success route you just add the path here. 如果要设置其他登录成功路线,只需在此处添加路径。 You can also combine this with the always_use_default_target_path option to send the user here after login, regardless of which URL they tried visit before authentication. 您也可以将其与always_use_default_target_path选项结合使用,以在登录后将用户发送到此处,无论他们在身份验证之前尝试访问了哪个URL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM