You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by 0xsven <0x...@gmail.com> on 2010/11/08 13:44:28 UTC

Logout problem

Hello,

I am using Shiro. When I tried to logout Shiro correctly logs my session out
but I am not redirected to my login page what I want.

I tried two different appraches:

1. Using Shiro.ini:
I includet following below [main]:
	authc.loginUrl = /welcome.xhtml

=> That doesn't work!

2. I tried to use JSF Navigation:
	public String logout() {
		if (currentUser.isAuthenticated()) {
		currentUser.logout();
		}
		return "welcome.xhtml";
	}
=> That doesn't work either...

Maybe the problem lies within facelets :-(
Does somebdy know how to fix that?

Cheers..
-- 
View this message in context: http://shiro-user.582556.n2.nabble.com/Logout-problem-tp5716711p5716711.html
Sent from the Shiro User mailing list archive at Nabble.com.

Re: Logout problem

Posted by Deluan Quintão <de...@deluan.com>.
Hi there,

If you are still struggling with this problem, try forcing a redirect to
your welcome.xhtml page, using this navigation-rule in your
faces-config.xml:

<navigation-rule>
<display-name>Login Rules</display-name>
<from-view-id>*</from-view-id>
<navigation-case>
<from-outcome>LOGOFF_OK</from-outcome>
<to-view-id>/welcome.xhtml</to-view-id>
<redirect /> <!--  FORCES THE REDIRECTION -->
</navigation-case>
</navigation-rule>

and in your logout action:

       public String logout() {
               if (currentUser.isAuthenticated()) {
                  currentUser.logout();
               }
               return "LOGOFF_OK";
       }

Let me know if this helps.

Regards,
Deluan

On Mon, Nov 8, 2010 at 10:44 AM, 0xsven <0x...@gmail.com> wrote:

>
> Hello,
>
> I am using Shiro. When I tried to logout Shiro correctly logs my session
> out
> but I am not redirected to my login page what I want.
>
> I tried two different appraches:
>
> 1. Using Shiro.ini:
> I includet following below [main]:
>        authc.loginUrl = /welcome.xhtml
>
> => That doesn't work!
>
> 2. I tried to use JSF Navigation:
>        public String logout() {
>                if (currentUser.isAuthenticated()) {
>                currentUser.logout();
>                }
>                return "welcome.xhtml";
>        }
> => That doesn't work either...
>
> Maybe the problem lies within facelets :-(
> Does somebdy know how to fix that?
>
> Cheers..
> --
> View this message in context:
> http://shiro-user.582556.n2.nabble.com/Logout-problem-tp5716711p5716711.html
> Sent from the Shiro User mailing list archive at Nabble.com.
>

Re: Logout problem

Posted by Les Hazlewood <lh...@apache.org>.
Hi there,

I've never used Shiro with JSF, so hopefully someone else who has can help
answer this.

Regards,

Les

On Mon, Nov 8, 2010 at 4:44 AM, 0xsven <0x...@gmail.com> wrote:

>
> Hello,
>
> I am using Shiro. When I tried to logout Shiro correctly logs my session
> out
> but I am not redirected to my login page what I want.
>
> I tried two different appraches:
>
> 1. Using Shiro.ini:
> I includet following below [main]:
>        authc.loginUrl = /welcome.xhtml
>
> => That doesn't work!
>
> 2. I tried to use JSF Navigation:
>        public String logout() {
>                if (currentUser.isAuthenticated()) {
>                currentUser.logout();
>                }
>                return "welcome.xhtml";
>        }
> => That doesn't work either...
>
> Maybe the problem lies within facelets :-(
> Does somebdy know how to fix that?
>
> Cheers..
> --
> View this message in context:
> http://shiro-user.582556.n2.nabble.com/Logout-problem-tp5716711p5716711.html
> Sent from the Shiro User mailing list archive at Nabble.com.