You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by pkerrigan <pk...@hp.com> on 2010/10/10 09:49:49 UTC

Shiro tags not working in Icefaces page.

I have tried to convert the Icefaces with spring security example program to
use Shiro instead of spring security, and while I can authenticate a user
and roles appear to work with Icefaces components I have been unable to get
tags to work.

If I have a conditional display of a field depending on role the field
always gets displayed.

Example:

<html xmlns:jsp="http://java.sun.com/JSP/Page"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core" version="2.0"
      xmlns:shiro="http://shiro.apache.org/tags"
      xmlns:ice="http://www.icesoft.com/icefaces/component">
<head>
    <title>Shiro Security with ICEfaces Components</title>
</head>
<body>
<p>Hi <shiro:guest>Guest</shiro:guest><shiro:user><shiro:principal/> is
logged on</shiro:user>
</p>
<shiro:authenticated>
<shiro:hasRole name="special">
            <ice:outputText
                    value="Shiro authenticated users with special role can
see this message."/>
</shiro:hasRole>
</shiro:authenticated>

Can anybody tell me what I am doing wrong?



-----
regards,
Philip Kerrigan
-- 
View this message in context: http://shiro-user.582556.n2.nabble.com/Shiro-tags-not-working-in-Icefaces-page-tp5619862p5619862.html
Sent from the Shiro User mailing list archive at Nabble.com.

Re: Shiro tags not working in Icefaces page.

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

Can you please attach the zip to a Jira issue?  Things like this get
lost quickly unless they're part of an issue.

Thanks,

-- 
Les Hazlewood
Founder, Katasoft, Inc.
Application Security Products & Professional Apache Shiro Support and Training:
http://www.katasoft.com

On Thu, Oct 14, 2010 at 1:56 PM, pkerrigan <pk...@hp.com> wrote:
>
> Yes, I do have an example program.
> I have tried to convert the Icefaces spring security demo program to use
> Shiro security, and I attach it.
> Be advised that I am not very conversant with Icefaces and there are quite
> possibly errors in the program or configuration.
>
> I have created a Maven2 POM file and am using the example with Eclipse 3.5
> and Tomcat 6.
> http://shiro-user.582556.n2.nabble.com/file/n5636692/IcefacesShiroSecurity.zip
> IcefacesShiroSecurity.zip
>
>
>
> -----
> regards,
> Philip Kerrigan
> --
> View this message in context: http://shiro-user.582556.n2.nabble.com/Shiro-tags-not-working-in-Icefaces-page-tp5619862p5636692.html
> Sent from the Shiro User mailing list archive at Nabble.com.

Re: Shiro tags not working in Icefaces page.

Posted by pkerrigan <pk...@hp.com>.
Yes, I do have an example program.
I have tried to convert the Icefaces spring security demo program to use
Shiro security, and I attach it.
Be advised that I am not very conversant with Icefaces and there are quite
possibly errors in the program or configuration.

I have created a Maven2 POM file and am using the example with Eclipse 3.5
and Tomcat 6.
http://shiro-user.582556.n2.nabble.com/file/n5636692/IcefacesShiroSecurity.zip
IcefacesShiroSecurity.zip 



-----
regards,
Philip Kerrigan
-- 
View this message in context: http://shiro-user.582556.n2.nabble.com/Shiro-tags-not-working-in-Icefaces-page-tp5619862p5636692.html
Sent from the Shiro User mailing list archive at Nabble.com.

Re: Shiro tags not working in Icefaces page.

Posted by Les Hazlewood <lh...@apache.org>.
Hrm, this sounds like it might be a configuration issue.  The JSP Tags
haven't been touched in a _long_ time, so I'm fairly confident they're
ok.  It's almost as if the Subject isn't being associated with the
thread correctly and the JSP tags can't 'see' it.

Can you show us your web.xml and shiro.ini?  Or is there a sample .war
that we could use to test?

-- 
Les Hazlewood
Founder, Katasoft, Inc.
Application Security Products & Professional Apache Shiro Support and Training:
http://www.katasoft.com

On Sun, Oct 10, 2010 at 2:36 PM, pkerrigan <pk...@hp.com> wrote:
>
> Hi Les,
>
> the other tags fail as well. Guest is shown although the user is
> authenticated, and principal shows nothing.
>
> -----
> regards,
> Philip Kerrigan
> --
> View this message in context: http://shiro-user.582556.n2.nabble.com/Shiro-tags-not-working-in-Icefaces-page-tp5619862p5621368.html
> Sent from the Shiro User mailing list archive at Nabble.com.
>

Re: Shiro tags not working in Icefaces page.

Posted by pkerrigan <pk...@hp.com>.
Hi Les,

the other tags fail as well. Guest is shown although the user is
authenticated, and principal shows nothing.

-----
regards,
Philip Kerrigan
-- 
View this message in context: http://shiro-user.582556.n2.nabble.com/Shiro-tags-not-working-in-Icefaces-page-tp5619862p5621368.html
Sent from the Shiro User mailing list archive at Nabble.com.

Re: Shiro tags not working in Icefaces page.

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

What about the other tags?  Do they fail as well?  I see you've used
shiro:guest, shiro:user, shiro:principal, and shiro:authenticated.
What happens for those?

Also note that you can set a debugger break point in the
org.apache.shiro.web.tags.RoleTag class in the onDoStartTag() method
implementation to see what happens when the tag is evaluated.

Cheers,

-- 
Les Hazlewood
Founder, Katasoft, Inc.
Application Security Products & Professional Apache Shiro Support and Training:
http://www.katasoft.com

On Sun, Oct 10, 2010 at 12:49 AM, pkerrigan <pk...@hp.com> wrote:
>
> I have tried to convert the Icefaces with spring security example program to
> use Shiro instead of spring security, and while I can authenticate a user
> and roles appear to work with Icefaces components I have been unable to get
> tags to work.
>
> If I have a conditional display of a field depending on role the field
> always gets displayed.
>
> Example:
>
> <html xmlns:jsp="http://java.sun.com/JSP/Page"
>      xmlns:h="http://java.sun.com/jsf/html"
>      xmlns:f="http://java.sun.com/jsf/core" version="2.0"
>      xmlns:shiro="http://shiro.apache.org/tags"
>      xmlns:ice="http://www.icesoft.com/icefaces/component">
> <head>
>    <title>Shiro Security with ICEfaces Components</title>
> </head>
> <body>
> <p>Hi <shiro:guest>Guest</shiro:guest><shiro:user><shiro:principal/> is
> logged on</shiro:user>
> </p>
> <shiro:authenticated>
> <shiro:hasRole name="special">
>            <ice:outputText
>                    value="Shiro authenticated users with special role can
> see this message."/>
> </shiro:hasRole>
> </shiro:authenticated>
>
> Can anybody tell me what I am doing wrong?
>
>
>
> -----
> regards,
> Philip Kerrigan
> --
> View this message in context: http://shiro-user.582556.n2.nabble.com/Shiro-tags-not-working-in-Icefaces-page-tp5619862p5619862.html
> Sent from the Shiro User mailing list archive at Nabble.com.
>

Re: Shiro tags not working in Icefaces page.

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

I didn't get time to port the sample to Shiro yet, but if you want to take a
look at it, you can download the taglib from
http://github.com/deluan/shiro-faces

Let me know if it worked for you or if you found any issue.

Regards,
Deluan.




On Mon, Oct 25, 2010 at 4:15 PM, Deluan Quintão <de...@deluan.com> wrote:

> Hi Philip,
>
> I've already converted my tags from JSecurity to Shiro, and will try to
> port the original Icefaces-Spring Security to Shiro.
>
> Regards,
> Deluan
>
>
>
> On Mon, Oct 25, 2010 at 9:53 AM, pkerrigan <pk...@hp.com> wrote:
>
>>
>> Hi Deluan,
>>
>> definitely of interest.
>>
>> It would be really good to end up with a demo program showing how Shiro
>> and
>> Icefaces can be used together.
>>
>> -----
>> regards,
>> Philip Kerrigan
>> --
>> View this message in context:
>> http://shiro-user.582556.n2.nabble.com/Shiro-tags-not-working-in-Icefaces-page-tp5619862p5670345.html
>> Sent from the Shiro User mailing list archive at Nabble.com.
>>
>
>

Re: Shiro tags not working in Icefaces page.

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

I've already converted my tags from JSecurity to Shiro, and will try to port
the original Icefaces-Spring Security to Shiro.

Regards,
Deluan



On Mon, Oct 25, 2010 at 9:53 AM, pkerrigan <pk...@hp.com> wrote:

>
> Hi Deluan,
>
> definitely of interest.
>
> It would be really good to end up with a demo program showing how Shiro and
> Icefaces can be used together.
>
> -----
> regards,
> Philip Kerrigan
> --
> View this message in context:
> http://shiro-user.582556.n2.nabble.com/Shiro-tags-not-working-in-Icefaces-page-tp5619862p5670345.html
> Sent from the Shiro User mailing list archive at Nabble.com.
>

Re: Shiro tags not working in Icefaces page.

Posted by pkerrigan <pk...@hp.com>.
Hi Deluan,

definitely of interest.

It would be really good to end up with a demo program showing how Shiro and
Icefaces can be used together.

-----
regards,
Philip Kerrigan
-- 
View this message in context: http://shiro-user.582556.n2.nabble.com/Shiro-tags-not-working-in-Icefaces-page-tp5619862p5670345.html
Sent from the Shiro User mailing list archive at Nabble.com.