Re: Creating a new Realm with Tapestry

2018-02-17 Thread Brian Demers
Good stuff! Thanks for following up!

-Brian

> On Feb 17, 2018, at 5:59 AM, cbenden  wrote:
> 
> Since I found my own question over and over in google while desperately
> seeking for information here the solution how I did it:
> 
> 1) create you Realm by deriving from AuthorizationRealm (or
> AuthenticationRealm if that is all you need). There are plenty of examples -
> you can all use them, they are not tapestry specific. Be sure to override
> getName (so you know this value). I created a package named security with
> all the stuff I needed for shiro in it (the place is really not important as
> you work with IOC and only the name of the class is important).
> 
> 2) weave the thing into you appModule:
>:
>public static void bind(ServiceBinder binder)
>{
>binder.bind(AuthorizingRealm.class,
> MyRealm.class).withId(MyRealm.class.getSimpleName());
>}
>/* this will add your realm */
>public static void contributeWebSecurityManager(Configuration
> configuration, @InjectService("MyRealm") AuthorizingRealm myRealm)
>{
>configuration.add(myRealm);
>}
>/* this will configure your realm - you can do this because of
> tapestry-secruity */
>public static void
> contributeSecurityConfiguration(OrderedConfiguration
> configuration,
>  
> SecurityFilterChainFactory factory)
>{
>// OrderedConfiguration must be named, so they can be overridden later
>configuration.add("signup-anon",
> factory.createChain("/authc/signup").add(factory.anon()).build());
>}
> 
> 
> 
> --
> Sent from: http://shiro-user.582556.n2.nabble.com/


Re: Creating a new Realm with Tapestry

2018-02-12 Thread Brian Demers
Take a look at: http://www.tynamo.org/tapestry-security+guide/

On Mon, Feb 12, 2018 at 6:28 AM, cbenden  wrote:

> Greetings all,
>
> I want to use shirk on my tapestry website. I have a webserivice that can
> authenticate users with logon credentials and also give roles back (which
> are assigned in the backend).
>
> I would like to create a custom shiro realm and integrate it in tapestry.
>
> Could please give me a head start were I should place these files (within
> Tapestry) and how to integrate them into the tapestry project (basically
> I'm
> looking for best practice here because I absolutely have no clue but since
> Tynamo is using shiro, I should be somehow work or tapestry too).
>
> Thanks.
> Clemens
>
>
>
> --
> Sent from: http://shiro-user.582556.n2.nabble.com/
>