liferay: redirect visitor to different page if the user is not found in the autologin hook
I've c开发者_Python百科reated an autologin hook, and this works fine to log the user in. However I'm now trying to redirect the user to a specific page on my portal in case the autologin fails (to localhost:8080/web/security/registerConditions).
However a response.sendRedirect to that URL seems to cause an infinite loop between the autologin and that page? Does anyone have any recommendations? For now I think that liferay's autologin might set the http code and that's causing the loop.
Naturally, if all URLs cause an anonymous session to redirect to some autologin url, this redirection loop will happen. You need to make sure that your /web/security/registerConditions page is available for anonymous users and doesn't trigger autologin.
A more specific answer would need more details about your implementation. You can try to look at Liferay's SSO-Filters to see how various single-sign-on-systems are integrated with Liferay.
精彩评论