Am trying to add a logout functionality in Shiro, I've add this in the JSP page:
<a href="/logout">Log Out</a>
and the shiro.ini look like this:
[main]
authc.loginUrl = /login.jsp
logout.redirectUrl = /logout.jsp
#[users]
#admin = p
#mike = p, reader
#joe = p, writer
[urls]
/login.jsp = authc
/logout.jsp = logout
/writer/** = user, roles[writer]
/success/** = user
#/** = anon
but when I try to logout, it give me a
HTTP Status 404 ... The requested resource () is not available.
If you reread the documentation they suggest to have
[urls]
/logout = logout
As is it looks like you have a redirect loop going: go to logout.jsp, invoke the logout filter, redirect to logout.jsp, invoke the logout filter, etc.
So far I've been able to get it to redirect properly using this method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With