[英]redirect from CAS login page when user is already logged in
We use CAS for authentication. 我们使用CAS进行身份验证。 The scenarios is as follows: 方案如下:
User attempts to access site www.awesomesite.com/coolthings. 用户尝试访问网站www.awesomesite.com/coolthings。
If user has not logged in yet they are taken to www.awesomesite.com/login which is actually CAS login. 如果用户尚未登录,则会将其带到www.awesomesite.com/login,这实际上是CAS登录。
User logs in and is taken to site they tried to get to, in this case www.awesomsite.com/coolthings. 用户登录并访问他们试图访问的站点,在本例中为www.awesomsite.com/coolthings。
Now, if the user goes to www.awesomesite.com/login when they are logged in, I would like to redirect them to a home page. 现在,如果用户在登录时访问www.awesomesite.com/login,我想将它们重定向到主页。 What actually happens is they go to the login page, CAS responds that they are logged in, but they aren't redirected anywhere because they put they are already at the url. 实际发生的是他们进入登录页面,CAS回复他们已登录,但他们没有被重定向到任何地方因为他们已经在网址上。 So they just sit on an empty page. 所以他们只是坐在空白页面上。 Is there a parameter I can set in the AutenticationFilter I can use to redirect from login if they're already logged in 我可以在AutenticationFilter中设置一个参数,如果他们已经登录,我可以使用它从登录重定向
I don't see any out-of-the box way to do that, I think you need to compute a default CAS service ( www.awesomesite.com/coolthings ) if no service is defined. 我没有看到任何开箱即用的方法,我认为如果没有定义服务,你需要计算默认的CAS服务( www.awesomesite.com/coolthings )。 I recommend to do that by overriding the initialFlowSetupAction (in the login-webflow.xml file). 我建议通过覆盖initialFlowSetupAction (在login-webflow.xml文件中)来做到这一点。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.