shiro logout not working for me

classic Classic list List threaded Threaded
1 message Options
pn
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

shiro logout not working for me

pn
This post has NOT been accepted by the mailing list yet.
I'm new to shiro and trying to create the simplest possible shiro login/logout authc webform example I can.

Login is working fine. Logout takes me to /logout (404 error) instead of logout.html, and it also does not log me out (I can still go to index.html).

Can anybody tell me what I am doing wrong, I've tried everything I can think of, and from the searches I've done it seems like it should work.

Thanks in advance.

Here is my code:

shiro.ini
[main]
authc.loginUrl = /login.html
logout.redirectUrl = /logout.html

[roles]
ROLE_ADMIN = *

[urls]
/login.html = authc
/logout = logout
/** = authc

login.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Login</title>
</head>
<body>
Login Page!
<form action="" method="POST">
   Username: <input type="text" name="username"/> <br>
   Password: <input type="password" name="password"/> <br>
   <button type="submit">Login</button>
</form>
</body>
</html>

index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Maven Shiro test</title>
</head>
<body>
Hello World!
<br>
<a href="/logout">Log Out</a>
</body>
</html>
Loading...