You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ronald Luke <ro...@ymail.com> on 2011/01/05 09:16:43 UTC
questions regarding tapestry, shiro, tapestry-security and the hotel-booking-demo
Hello, guys,
I am having a very hard time trying to figure out how to use shiro in tapestry.
Now I'm looking at the wonderful T5 hotel-booking-demo(using tynamo's
tapestry-security) code. If a visitor is not logged in , when she goes to the
search page, she will be redirected to the signin page. Looking at the
Search.java, I don't understand how it works. Here's the code http://ja.gs/Ce. I
don't see any service injected which can check if user logs in and redirect.
Please shed some light on this.
Thanks much.
Ron
Re: questions regarding tapestry, shiro, tapestry-security and the
hotel-booking-demo
Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Wed, 05 Jan 2011 06:16:43 -0200, Ronald Luke <ro...@ymail.com>
wrote:
> Hello, guys,
Hi!
> Now I'm looking at the wonderful T5 hotel-booking-demo(using tynamo's
> tapestry-security) code. If a visitor is not logged in , when she goes
> to the search page, she will be redirected to the signin page. Looking
> at the
> Search.java, I don't understand how it works. Here's the code
> http://ja.gs/Ce. I don't see any service injected which can check if
> user logs in and redirect.
Complementing Taha's answer: that's the beauty of its implementation and
also of Tapestry: it is implemented as a RequestFilter, so you don't need
any code in your pages to have them secured. The login redirection logic
is implemented in a single place and invoked for each page.
--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: questions regarding tapestry, shiro, tapestry-security and the hotel-booking-demo
Posted by Ronald Luke <ro...@ymail.com>.
Thanks, Taha, that really helped, I got it working.
Ron
________________________________
From: Taha Hafeez <ta...@gmail.com>
To: Tapestry users <us...@tapestry.apache.org>
Sent: Wed, January 5, 2011 4:21:49 PM
Subject: Re: questions regarding tapestry, shiro, tapestry-security and the
hotel-booking-demo
The configuration is in the AppModule
particularly
public static void
contributeFactoryDefaults(MappedConfiguration<String, String>
configuration)
{
configuration.override(SecuritySymbols.LOGIN_URL, "/signin");
configuration.override(SecuritySymbols.SUCCESS_URL, "/search");
configuration.override(SecuritySymbols.DEFAULTSIGNINPAGE, "/signin");
configuration.override(SecuritySymbols.SHOULD_LOAD_INI_FROM_CONFIG_PATH,
"false");
}
and
public static void
contributeWebSecurityManager(Configuration<Realm> configuration,
@Inject AuthorizingRealm realm)
{
configuration.add(realm);
}
public static void contributeSecurityRequestFilter(
OrderedConfiguration<FilterChainDefinition> configuration)
{
configuration.add("assets", new
FilterChainDefinition(RequestConstants.ASSET_PATH_PREFIX
+ "**", "anon"));
configuration.add("signin", new
FilterChainDefinition("/signin**", "anon"), "after:assets");
configuration.add("signup", new
FilterChainDefinition("/signup**", "anon"), "after:signin");
configuration.add("secured", new FilterChainDefinition("/**",
"authc"), "after:signup");
}
regards
Taha
On Wed, Jan 5, 2011 at 1:46 PM, Ronald Luke <ro...@ymail.com> wrote:
> Hello, guys,
>
> I am having a very hard time trying to figure out how to use shiro in
> tapestry.
>
> Now I'm looking at the wonderful T5 hotel-booking-demo(using tynamo's
> tapestry-security) code. If a visitor is not logged in , when she goes to
> the
> search page, she will be redirected to the signin page. Looking at the
> Search.java, I don't understand how it works. Here's the code
> http://ja.gs/Ce. I
> don't see any service injected which can check if user logs in and
> redirect.
>
> Please shed some light on this.
>
> Thanks much.
>
> Ron
>
>
>
Re: questions regarding tapestry, shiro, tapestry-security and the hotel-booking-demo
Posted by Taha Hafeez <ta...@gmail.com>.
The configuration is in the AppModule
particularly
public static void
contributeFactoryDefaults(MappedConfiguration<String, String>
configuration)
{
configuration.override(SecuritySymbols.LOGIN_URL, "/signin");
configuration.override(SecuritySymbols.SUCCESS_URL, "/search");
configuration.override(SecuritySymbols.DEFAULTSIGNINPAGE, "/signin");
configuration.override(SecuritySymbols.SHOULD_LOAD_INI_FROM_CONFIG_PATH,
"false");
}
and
public static void
contributeWebSecurityManager(Configuration<Realm> configuration,
@Inject AuthorizingRealm realm)
{
configuration.add(realm);
}
public static void contributeSecurityRequestFilter(
OrderedConfiguration<FilterChainDefinition> configuration)
{
configuration.add("assets", new
FilterChainDefinition(RequestConstants.ASSET_PATH_PREFIX
+ "**", "anon"));
configuration.add("signin", new
FilterChainDefinition("/signin**", "anon"), "after:assets");
configuration.add("signup", new
FilterChainDefinition("/signup**", "anon"), "after:signin");
configuration.add("secured", new FilterChainDefinition("/**",
"authc"), "after:signup");
}
regards
Taha
On Wed, Jan 5, 2011 at 1:46 PM, Ronald Luke <ro...@ymail.com> wrote:
> Hello, guys,
>
> I am having a very hard time trying to figure out how to use shiro in
> tapestry.
>
> Now I'm looking at the wonderful T5 hotel-booking-demo(using tynamo's
> tapestry-security) code. If a visitor is not logged in , when she goes to
> the
> search page, she will be redirected to the signin page. Looking at the
> Search.java, I don't understand how it works. Here's the code
> http://ja.gs/Ce. I
> don't see any service injected which can check if user logs in and
> redirect.
>
> Please shed some light on this.
>
> Thanks much.
>
> Ron
>
>
>