Re: Tapestry + Acegi + Spring integration

2006-07-12 Thread Gernot Stocker
On Wednesday 12 July 2006 13:48, James Carman wrote:
> hivemodule.xml file to get that to work.  Why can't you just plug your own
> SSO filter into the existing pipeline by using a symbol override?

just to make clear I'm not really familiar with Hivemind, I just use it to 
reach 
the Spring Beans ;-(. 

Does this mean I can simply override in my Application's hivemodule.xml?

      
 
 


That would be easy! Unfortunately I can't test it right now, but I will give it 
a try later.

Does the SecuredMethodEnhancementWorker also work for Hivemind Services like 
FileDownload etc.?

Thanks,
 Gernot

-- 
Gernot Stocker,
Institute for Genomics and Bioinformatics(IGB)
Petersgasse 14, 8010 Graz, Austria
Tel.: ++43 316 873 5345
http://genome.tugraz.at


pgpj6Xx7AkFsr.pgp
Description: PGP signature


RE: Tapestry + Acegi + Spring integration

2006-07-12 Thread James Carman
You can use a symbol override for that:

  
  


-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Jesper Zedlitz
Sent: Wednesday, July 12, 2006 8:58 AM
To: users@tapestry.apache.org
Subject: RE: Tapestry + Acegi + Spring integration

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

James Carman wrote:
> What did you mean by "How do I change the name used for HTTP basic
> authentication?" on the Wiki?
> 
Ok, "realm name"  is more percise. 
Right now it is "Acegi Security" but I would like to change it to something
like "super secrect area".

Jesper

- -- 
 Jesper Zedlitz   eMail: [EMAIL PROTECTED]
  Homepage : http://www.zedlitz.de
  ICQ# : 23890711
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFEtPH6jSxW58yLxdgRAs2nAJsHrxb1rML8TcHgDaCzL4JHGbNzNACePT1G
mTQhEzPeJoPQF4oq8/o4aMU=
=fEIQ
-END PGP SIGNATURE-


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tapestry + Acegi + Spring integration

2006-07-12 Thread Jesper Zedlitz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

James Carman wrote:
> What did you mean by "How do I change the name used for HTTP basic
> authentication?" on the Wiki?
> 
Ok, "realm name"  is more percise. 
Right now it is "Acegi Security" but I would like to change it to something
like "super secrect area".

Jesper

- -- 
 Jesper Zedlitz   eMail: [EMAIL PROTECTED]
  Homepage : http://www.zedlitz.de
  ICQ# : 23890711
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFEtPH6jSxW58yLxdgRAs2nAJsHrxb1rML8TcHgDaCzL4JHGbNzNACePT1G
mTQhEzPeJoPQF4oq8/o4aMU=
=fEIQ
-END PGP SIGNATURE-


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tapestry + Acegi + Spring integration

2006-07-12 Thread James Carman
What did you mean by "How do I change the name used for HTTP basic
authentication?" on the Wiki?

-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Jesper Zedlitz
Sent: Tuesday, July 11, 2006 8:32 AM
To: users@tapestry.apache.org
Subject: RE: Tapestry + Acegi + Spring integration

James Carman wrote:
> You can tell HiveMind to use a different password encoder if you want. 
> All you have to do is override the symbol
> hivemind.acegi.dao.passwordEncoder: 
>  
> value="org.acegisecurity.providers.encoding.Md5PasswordEncoder"/>
> 
>
Ok, that helps. Now I do not have to re-encode the password anymore. 
To use a plaintext password I use this configuration:
 
   
 
 

 
It is important that in the case of a plaintext password the salt is an
empty string. Otherwise it would be added after the password and the login
would fail.


Is there a way to get rid of my helper class that just forwards the
UserDetails object?

Right now the "implementation" element in my hivemodule.xml looks like this:

 
   
 
   
 



Jesper

-- 
 Jesper Zedlitz   eMail: [EMAIL PROTECTED]
  Homepage : http://www.zedlitz.de
  ICQ# : 23890711


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tapestry + Acegi + Spring integration

2006-07-12 Thread James Carman
The tapestry-acegi module allows you to use the Acegi servlet filters as
ServletRequestServicerFilters.  So, you can just add a javax.servlet.Filter
to the pipeline and it will automatically wrap it to adapt it to the proper
interface.  Since the "filterChainProxy" implements javax.servlet.Filter, I
think that might just work.  Of course, you can't really override a
contribution.  You'd actually have to change the tapestry-acegi
hivemodule.xml file to get that to work.  Why can't you just plug your own
SSO filter into the existing pipeline by using a symbol override?

-Original Message-
From: Gernot Stocker [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 12, 2006 7:42 AM
To: Tapestry users
Subject: Re: Tapestry + Acegi + Spring integration

On Tuesday 11 July 2006 20:30, James Carman wrote:
> Yeah, when I added tapestry-acegi support into our project at work, the
> people were quite amazed at how easy it was to secure a page.

Hi,
I would like to use the tapestry-acegi project for ACEGI-security-checks in
pages, having 
already implemented a SSO authentication javax.servlet.Filter / 
org.acegisecurity.ui.webapp.AuthenticationProcessingFilter  for
authentication. 

In order to get a cleaner tapestry integration I would like to move the glue
configuration 
from web.xml into hivemodule.xml by using the existing Spring-internal
FilterChainProxy 
configuration. 

Does something  speak against overwriting the following hivemind
configuration:







with: 




Where the spring configuration looks something like this:

   
  
 
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
PATTERN_TYPE_APACHE_ANT
 
/**=httpSessionContextIntegrationFilter,authenticationProcessingFilter,anony
mousProcessingFilter,exceptionTranslationFilter,filterInvocationInterceptor
 
  


and do the @Secure Annotations still work after this change?

Thanks,
Gernot
-- 
Gernot Stocker,
Institute for Genomics and Bioinformatics(IGB)
Petersgasse 14, 8010 Graz, Austria
Tel.: ++43 316 873 5345
http://genome.tugraz.at



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tapestry + Acegi + Spring integration

2006-07-12 Thread Gernot Stocker
On Tuesday 11 July 2006 20:30, James Carman wrote:
> Yeah, when I added tapestry-acegi support into our project at work, the
> people were quite amazed at how easy it was to secure a page.

Hi,
I would like to use the tapestry-acegi project for ACEGI-security-checks in 
pages, having 
already implemented a SSO authentication javax.servlet.Filter / 
org.acegisecurity.ui.webapp.AuthenticationProcessingFilter  for authentication. 

In order to get a cleaner tapestry integration I would like to move the glue 
configuration 
from web.xml into hivemodule.xml by using the existing Spring-internal 
FilterChainProxy 
configuration. 

Does something  speak against overwriting the following hivemind configuration:







with: 




Where the spring configuration looks something like this:

   
  
 
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
PATTERN_TYPE_APACHE_ANT

/**=httpSessionContextIntegrationFilter,authenticationProcessingFilter,anonymousProcessingFilter,exceptionTranslationFilter,filterInvocationInterceptor
 
  


and do the @Secure Annotations still work after this change?

Thanks,
Gernot
-- 
Gernot Stocker,
Institute for Genomics and Bioinformatics(IGB)
Petersgasse 14, 8010 Graz, Austria
Tel.: ++43 316 873 5345
http://genome.tugraz.at


pgptzn4Sq0UBO.pgp
Description: PGP signature


RE: Tapestry + Acegi + Spring integration

2006-07-11 Thread James Carman
Yeah, when I added tapestry-acegi support into our project at work, the
people were quite amazed at how easy it was to secure a page.

-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Jesper Zedlitz
Sent: Tuesday, July 11, 2006 2:24 PM
To: users@tapestry.apache.org
Subject: Re: Tapestry + Acegi + Spring integration

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

With several tips from James I have been able to make the example clearer
than it already was. Securing Tapestry pages is so easy - it is almost
frightened. ;-)

I have added a dependency to hivemind-lib. That makes it possible to get rid
of the helper class and set the Spring bean "memoryAuthenticationDao"
directly as "hivemind.acegi.dao.UserDetailsService".

BTW: The example can now be found the the Tapestry Wiki
http://wiki.apache.org/tapestry/AcegiSpringJava5

Jesper

- -- 
 Jesper Zedlitz   eMail: [EMAIL PROTECTED]  
  Homepage : http://www.zedlitz.de  
  ICQ# : 23890711   
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFEs+zOjSxW58yLxdgRAqwqAKCLuLO184ZDpNp6JYaPsmLnf8NBygCg4iAF
dt6tl4EzNPbhdB2Ut1zLzYE=
=9LmY
-END PGP SIGNATURE-


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tapestry + Acegi + Spring integration

2006-07-11 Thread Jesper Zedlitz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

With several tips from James I have been able to make the example clearer
than it already was. Securing Tapestry pages is so easy - it is almost
frightened. ;-)

I have added a dependency to hivemind-lib. That makes it possible to get rid
of the helper class and set the Spring bean "memoryAuthenticationDao"
directly as "hivemind.acegi.dao.UserDetailsService".

BTW: The example can now be found the the Tapestry Wiki
http://wiki.apache.org/tapestry/AcegiSpringJava5

Jesper

- -- 
 Jesper Zedlitz   eMail: [EMAIL PROTECTED]  
  Homepage : http://www.zedlitz.de  
  ICQ# : 23890711   
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFEs+zOjSxW58yLxdgRAqwqAKCLuLO184ZDpNp6JYaPsmLnf8NBygCg4iAF
dt6tl4EzNPbhdB2Ut1zLzYE=
=9LmY
-END PGP SIGNATURE-


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tapestry + Acegi + Spring integration

2006-07-11 Thread James Carman
If you have a Spring bean (which it looks like you do) that implements
UserDetailsService, then you can use the
hivemind.library.SpringLookupFactory to provide the implementation for your
service:


  

  


 
-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Jesper Zedlitz
Sent: Tuesday, July 11, 2006 8:32 AM
To: users@tapestry.apache.org
Subject: RE: Tapestry + Acegi + Spring integration

James Carman wrote:
> You can tell HiveMind to use a different password encoder if you want. 
> All you have to do is override the symbol
> hivemind.acegi.dao.passwordEncoder: 
>  
> value="org.acegisecurity.providers.encoding.Md5PasswordEncoder"/>
> 
>
Ok, that helps. Now I do not have to re-encode the password anymore. 
To use a plaintext password I use this configuration:
 
   
 
 

 
It is important that in the case of a plaintext password the salt is an
empty string. Otherwise it would be added after the password and the login
would fail.


Is there a way to get rid of my helper class that just forwards the
UserDetails object?

Right now the "implementation" element in my hivemodule.xml looks like this:

 
   
 
   
 



Jesper

-- 
 Jesper Zedlitz   eMail: [EMAIL PROTECTED]
  Homepage : http://www.zedlitz.de
  ICQ# : 23890711


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tapestry + Acegi + Spring integration

2006-07-11 Thread Jesper Zedlitz
James Carman wrote:
> You can tell HiveMind to use a different password encoder if you want. 
> All you have to do is override the symbol
> hivemind.acegi.dao.passwordEncoder: 
>  
> value="org.acegisecurity.providers.encoding.Md5PasswordEncoder"/>
> 
>
Ok, that helps. Now I do not have to re-encode the password anymore. 
To use a plaintext password I use this configuration:
 
   
 
 

 
It is important that in the case of a plaintext password the salt is an
empty string. Otherwise it would be added after the password and the login
would fail.


Is there a way to get rid of my helper class that just forwards the
UserDetails object?

Right now the "implementation" element in my hivemodule.xml looks like this:

 
   
 
   
 



Jesper

-- 
 Jesper Zedlitz   eMail: [EMAIL PROTECTED]
  Homepage : http://www.zedlitz.de
  ICQ# : 23890711


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tapestry + Acegi + Spring integration

2006-07-11 Thread Jesper Zedlitz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

ZedroS Schwart wrote:
> I wonder, Jesper, if you wouldn't have an advantage of using James'
> Tapernate stuff. If not, why ?
> 
I am using James' tapestry-acegi library. My applications make heavy use of
the Spring framework. So I was looking for a way to use the already
existing bean that implements Acegi's UserDetailsService. 

Jesper

- -- 
 Jesper Zedlitz   eMail: [EMAIL PROTECTED]
  Homepage : http://www.zedlitz.de
  ICQ# : 23890711
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFEs5TJjSxW58yLxdgRAsUrAJ9h2twhmDiFiwLMQXdl8usc8tGPjgCfTWvs
AOkdsK9BdsKw8kTyf8tWDf0=
=jLxr
-END PGP SIGNATURE-


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tapestry + Acegi + Spring integration

2006-07-11 Thread James Carman
Oh, by the way, if there are any ambitious folks out there using the
tapestry-acegi (or tapernate for that matter) modules and you want to
provide some documentation, feel free to drop me a patch via email and I'd
be glad to merge it in.

-Original Message-
From: James Carman [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 11, 2006 7:13 AM
To: 'Tapestry users'
Subject: RE: Tapestry + Acegi + Spring integration

Yes, +1.  A nice Wiki entry about this stuff would be great (and it would
help me document my stuff :-).  Do you think we should put it in the main
Tapestry Wiki?

-Original Message-
From: ZedroS Schwart [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 11, 2006 7:10 AM
To: Tapestry users
Subject: Re: Tapestry + Acegi + Spring integration

I'm not a lot in this Hibernate/Spring/Acegi stuff currently but I'm
really curious about it.

I wonder, Jesper, if you wouldn't have an advantage of using James'
Tapernate stuff. If not, why ?

BTW, I think the Wiki is the best place where such excellent mail
should end up !

Cheers
ZedroS
On 7/11/06, James Carman <[EMAIL PROTECTED]> wrote:
> You can tell HiveMind to use a different password encoder if you want.
All
> you have to do is override the symbol hivemind.acegi.dao.passwordEncoder:
>
> 
>symbol="hivemind.acegi.dao.passwordEncoder"
> value="org.acegisecurity.providers.encoding.Md5PasswordEncoder"/>
> 
>
> -Original Message-
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Jesper Zedlitz
> Sent: Tuesday, July 11, 2006 3:31 AM
> To: users@tapestry.apache.org
> Subject: Tapestry + Acegi + Spring integration
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> The integration of Tapestry, Acegi and Spring seems to be a hot topic.
>
> I have created a simple example that shows how that can be done. The
> complete source code can be found here:
> http://www.zedlitz.de/tapestry-acegi.zip (8kB)
>
> If you have Maven2 installed you can go into the directoy tapestry-acegi
and
> enter the command "mvn jetty6:run". Then you can access the application
via
> this URL: http://localhost:8080/tapestry-acegi/app
>
> First I needed two pages (one secured):
> * src/main/webapp/Home.html
> * src/main/webapp/Secured.html
>
> Each of these pages is accompanied by a Java class:
> * src/main/java/de/zedlitz/tapestry/acegi/Home.java
> * src/main/java/de/zedlitz/tapestry/acegi/Secured.java (This is the only
> place where you have to specify that this page is secured!)
>
> I have to tell Tapestry in which package to find the classes:
> * src/main/webapp/WEB-INF/tapestry-acegi.application
>
> A standard webapplication setup for Tapestry and Spring:
> * src/main/webapp/WEB-INF/web.xml
>
> The Spring configuration is also not spectacular. Every Spring enabled
> application that uses Acegi has something like that.
> * src/main/resources/applicationContext.xml
>
> Only three beans are created here:
> * memoryAuthenticationDao (In the example the username and password is
> specified here. But of course you can put any complex bean here to
retrieve
> user information.)
> * daoAuthenticationProvider
> * authenticationManager
>
>
> Now the interesting part - how to put it together:
> * src/main/resources/META-INF/hivemodule.xml
> * src/main/java/de/zedlitz/tapestry/acegi/UserDetailsServiceImpl.java
>
> The service point "SpringApplicationInitializer" gives you access to
> Spring's beans. I have written an implementation for the service
> "hivemind.acegi.dao.UserDetailsService",
> de.zedlitz.tapestry.acegi.UserDetailsServiceImpl that combines a Spring
> UserDetailsService, the PasswordEncoder and the configured salt. From
> hivemodule.xml:
> 
>   
>
>   value="spring:memoryAuthenticationDao"/>
> service-id="hivemind.acegi.dao.PasswordEncoder"/>
>  
>
>   
> 
>
> The dependencies from pom.xml are probably also interesting:
> * tapestry/tapestry-annotations 4.0.1
> * tapestry/tapestry 4.0.1
> * org.springframework/spring  1.2.6
> * org.acegisecurity/acegi-security-tiger 1.0.1
> * com.javaforge.tapestry/tapestry-spring  0.1.2
> * com.javaforge.tapestry/tapestry-acegi  0.1-SNAPSHOT
> * com.javaforge.hivemind/hivemind-acegi-dao  0.1-SNAPSHOT
>
>
> I think that the solution could be made easier. My UserDetailsServiceImpl
> class basicly forwards a UserDetails object. The encoding of the password
> could be unnecessary if you could tell Hivemind to use a different
> PasswordEncoder.
>
> Jesper
>
> - --
>  Jesper Zedlitz   eMail: [EMAIL PROTECTED]
>   Homepage : http://www.zedlitz

RE: Tapestry + Acegi + Spring integration

2006-07-11 Thread James Carman
Yes, +1.  A nice Wiki entry about this stuff would be great (and it would
help me document my stuff :-).  Do you think we should put it in the main
Tapestry Wiki?

-Original Message-
From: ZedroS Schwart [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 11, 2006 7:10 AM
To: Tapestry users
Subject: Re: Tapestry + Acegi + Spring integration

I'm not a lot in this Hibernate/Spring/Acegi stuff currently but I'm
really curious about it.

I wonder, Jesper, if you wouldn't have an advantage of using James'
Tapernate stuff. If not, why ?

BTW, I think the Wiki is the best place where such excellent mail
should end up !

Cheers
ZedroS
On 7/11/06, James Carman <[EMAIL PROTECTED]> wrote:
> You can tell HiveMind to use a different password encoder if you want.
All
> you have to do is override the symbol hivemind.acegi.dao.passwordEncoder:
>
> 
>symbol="hivemind.acegi.dao.passwordEncoder"
> value="org.acegisecurity.providers.encoding.Md5PasswordEncoder"/>
> 
>
> -Original Message-
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Jesper Zedlitz
> Sent: Tuesday, July 11, 2006 3:31 AM
> To: users@tapestry.apache.org
> Subject: Tapestry + Acegi + Spring integration
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> The integration of Tapestry, Acegi and Spring seems to be a hot topic.
>
> I have created a simple example that shows how that can be done. The
> complete source code can be found here:
> http://www.zedlitz.de/tapestry-acegi.zip (8kB)
>
> If you have Maven2 installed you can go into the directoy tapestry-acegi
and
> enter the command "mvn jetty6:run". Then you can access the application
via
> this URL: http://localhost:8080/tapestry-acegi/app
>
> First I needed two pages (one secured):
> * src/main/webapp/Home.html
> * src/main/webapp/Secured.html
>
> Each of these pages is accompanied by a Java class:
> * src/main/java/de/zedlitz/tapestry/acegi/Home.java
> * src/main/java/de/zedlitz/tapestry/acegi/Secured.java (This is the only
> place where you have to specify that this page is secured!)
>
> I have to tell Tapestry in which package to find the classes:
> * src/main/webapp/WEB-INF/tapestry-acegi.application
>
> A standard webapplication setup for Tapestry and Spring:
> * src/main/webapp/WEB-INF/web.xml
>
> The Spring configuration is also not spectacular. Every Spring enabled
> application that uses Acegi has something like that.
> * src/main/resources/applicationContext.xml
>
> Only three beans are created here:
> * memoryAuthenticationDao (In the example the username and password is
> specified here. But of course you can put any complex bean here to
retrieve
> user information.)
> * daoAuthenticationProvider
> * authenticationManager
>
>
> Now the interesting part - how to put it together:
> * src/main/resources/META-INF/hivemodule.xml
> * src/main/java/de/zedlitz/tapestry/acegi/UserDetailsServiceImpl.java
>
> The service point "SpringApplicationInitializer" gives you access to
> Spring's beans. I have written an implementation for the service
> "hivemind.acegi.dao.UserDetailsService",
> de.zedlitz.tapestry.acegi.UserDetailsServiceImpl that combines a Spring
> UserDetailsService, the PasswordEncoder and the configured salt. From
> hivemodule.xml:
> 
>   
>
>   value="spring:memoryAuthenticationDao"/>
> service-id="hivemind.acegi.dao.PasswordEncoder"/>
>  
>
>   
> 
>
> The dependencies from pom.xml are probably also interesting:
> * tapestry/tapestry-annotations 4.0.1
> * tapestry/tapestry 4.0.1
> * org.springframework/spring  1.2.6
> * org.acegisecurity/acegi-security-tiger 1.0.1
> * com.javaforge.tapestry/tapestry-spring  0.1.2
> * com.javaforge.tapestry/tapestry-acegi  0.1-SNAPSHOT
> * com.javaforge.hivemind/hivemind-acegi-dao  0.1-SNAPSHOT
>
>
> I think that the solution could be made easier. My UserDetailsServiceImpl
> class basicly forwards a UserDetails object. The encoding of the password
> could be unnecessary if you could tell Hivemind to use a different
> PasswordEncoder.
>
> Jesper
>
> - --
>  Jesper Zedlitz   eMail: [EMAIL PROTECTED]
>   Homepage : http://www.zedlitz.de
>   ICQ# : 23890711
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.1 (GNU/Linux)
>
> iD8DBQFEs1OgjSxW58yLxdgRAnqvAKDAfjpbyZPSLroWSK/xSWtVd6YwhACg63tF
> U7a/UQZyLIf8IHXa0/WUV0o=
> =vFNN
> -END PGP SIGNATURE-
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAI

Re: Tapestry + Acegi + Spring integration

2006-07-11 Thread ZedroS Schwart

I'm not a lot in this Hibernate/Spring/Acegi stuff currently but I'm
really curious about it.

I wonder, Jesper, if you wouldn't have an advantage of using James'
Tapernate stuff. If not, why ?

BTW, I think the Wiki is the best place where such excellent mail
should end up !

Cheers
ZedroS
On 7/11/06, James Carman <[EMAIL PROTECTED]> wrote:

You can tell HiveMind to use a different password encoder if you want.  All
you have to do is override the symbol hivemind.acegi.dao.passwordEncoder:


  


-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Jesper Zedlitz
Sent: Tuesday, July 11, 2006 3:31 AM
To: users@tapestry.apache.org
Subject: Tapestry + Acegi + Spring integration

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

The integration of Tapestry, Acegi and Spring seems to be a hot topic.

I have created a simple example that shows how that can be done. The
complete source code can be found here:
http://www.zedlitz.de/tapestry-acegi.zip (8kB)

If you have Maven2 installed you can go into the directoy tapestry-acegi and
enter the command "mvn jetty6:run". Then you can access the application via
this URL: http://localhost:8080/tapestry-acegi/app

First I needed two pages (one secured):
* src/main/webapp/Home.html
* src/main/webapp/Secured.html

Each of these pages is accompanied by a Java class:
* src/main/java/de/zedlitz/tapestry/acegi/Home.java
* src/main/java/de/zedlitz/tapestry/acegi/Secured.java (This is the only
place where you have to specify that this page is secured!)

I have to tell Tapestry in which package to find the classes:
* src/main/webapp/WEB-INF/tapestry-acegi.application

A standard webapplication setup for Tapestry and Spring:
* src/main/webapp/WEB-INF/web.xml

The Spring configuration is also not spectacular. Every Spring enabled
application that uses Acegi has something like that.
* src/main/resources/applicationContext.xml

Only three beans are created here:
* memoryAuthenticationDao (In the example the username and password is
specified here. But of course you can put any complex bean here to retrieve
user information.)
* daoAuthenticationProvider
* authenticationManager


Now the interesting part - how to put it together:
* src/main/resources/META-INF/hivemodule.xml
* src/main/java/de/zedlitz/tapestry/acegi/UserDetailsServiceImpl.java

The service point "SpringApplicationInitializer" gives you access to
Spring's beans. I have written an implementation for the service
"hivemind.acegi.dao.UserDetailsService",
de.zedlitz.tapestry.acegi.UserDetailsServiceImpl that combines a Spring
UserDetailsService, the PasswordEncoder and the configured salt. From
hivemodule.xml:

  
   
 
 
 
   
  


The dependencies from pom.xml are probably also interesting:
* tapestry/tapestry-annotations 4.0.1
* tapestry/tapestry 4.0.1
* org.springframework/spring  1.2.6
* org.acegisecurity/acegi-security-tiger 1.0.1
* com.javaforge.tapestry/tapestry-spring  0.1.2
* com.javaforge.tapestry/tapestry-acegi  0.1-SNAPSHOT
* com.javaforge.hivemind/hivemind-acegi-dao  0.1-SNAPSHOT


I think that the solution could be made easier. My UserDetailsServiceImpl
class basicly forwards a UserDetails object. The encoding of the password
could be unnecessary if you could tell Hivemind to use a different
PasswordEncoder.

Jesper

- --
 Jesper Zedlitz   eMail: [EMAIL PROTECTED]
  Homepage : http://www.zedlitz.de
  ICQ# : 23890711
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFEs1OgjSxW58yLxdgRAnqvAKDAfjpbyZPSLroWSK/xSWtVd6YwhACg63tF
U7a/UQZyLIf8IHXa0/WUV0o=
=vFNN
-END PGP SIGNATURE-


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tapestry + Acegi + Spring integration

2006-07-11 Thread James Carman
You can tell HiveMind to use a different password encoder if you want.  All
you have to do is override the symbol hivemind.acegi.dao.passwordEncoder:


  


-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Jesper Zedlitz
Sent: Tuesday, July 11, 2006 3:31 AM
To: users@tapestry.apache.org
Subject: Tapestry + Acegi + Spring integration

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

The integration of Tapestry, Acegi and Spring seems to be a hot topic.

I have created a simple example that shows how that can be done. The
complete source code can be found here:
http://www.zedlitz.de/tapestry-acegi.zip (8kB)

If you have Maven2 installed you can go into the directoy tapestry-acegi and
enter the command "mvn jetty6:run". Then you can access the application via
this URL: http://localhost:8080/tapestry-acegi/app

First I needed two pages (one secured):
* src/main/webapp/Home.html
* src/main/webapp/Secured.html 

Each of these pages is accompanied by a Java class:
* src/main/java/de/zedlitz/tapestry/acegi/Home.java 
* src/main/java/de/zedlitz/tapestry/acegi/Secured.java (This is the only
place where you have to specify that this page is secured!)

I have to tell Tapestry in which package to find the classes:
* src/main/webapp/WEB-INF/tapestry-acegi.application 

A standard webapplication setup for Tapestry and Spring:
* src/main/webapp/WEB-INF/web.xml 

The Spring configuration is also not spectacular. Every Spring enabled
application that uses Acegi has something like that.
* src/main/resources/applicationContext.xml

Only three beans are created here:
* memoryAuthenticationDao (In the example the username and password is
specified here. But of course you can put any complex bean here to retrieve
user information.)
* daoAuthenticationProvider
* authenticationManager


Now the interesting part - how to put it together:
* src/main/resources/META-INF/hivemodule.xml
* src/main/java/de/zedlitz/tapestry/acegi/UserDetailsServiceImpl.java

The service point "SpringApplicationInitializer" gives you access to
Spring's beans. I have written an implementation for the service
"hivemind.acegi.dao.UserDetailsService",
de.zedlitz.tapestry.acegi.UserDetailsServiceImpl that combines a Spring
UserDetailsService, the PasswordEncoder and the configured salt. From
hivemodule.xml:

  
   
 
 
 
   
  


The dependencies from pom.xml are probably also interesting:
* tapestry/tapestry-annotations 4.0.1
* tapestry/tapestry 4.0.1
* org.springframework/spring  1.2.6
* org.acegisecurity/acegi-security-tiger 1.0.1
* com.javaforge.tapestry/tapestry-spring  0.1.2
* com.javaforge.tapestry/tapestry-acegi  0.1-SNAPSHOT
* com.javaforge.hivemind/hivemind-acegi-dao  0.1-SNAPSHOT


I think that the solution could be made easier. My UserDetailsServiceImpl
class basicly forwards a UserDetails object. The encoding of the password
could be unnecessary if you could tell Hivemind to use a different
PasswordEncoder. 

Jesper

- -- 
 Jesper Zedlitz   eMail: [EMAIL PROTECTED]
  Homepage : http://www.zedlitz.de
  ICQ# : 23890711
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFEs1OgjSxW58yLxdgRAnqvAKDAfjpbyZPSLroWSK/xSWtVd6YwhACg63tF
U7a/UQZyLIf8IHXa0/WUV0o=
=vFNN
-END PGP SIGNATURE-


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tapestry + Acegi + Spring integration

2006-07-11 Thread Jesper Zedlitz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

The integration of Tapestry, Acegi and Spring seems to be a hot topic.

I have created a simple example that shows how that can be done. The
complete source code can be found here:
http://www.zedlitz.de/tapestry-acegi.zip (8kB)

If you have Maven2 installed you can go into the directoy tapestry-acegi and
enter the command "mvn jetty6:run". Then you can access the application via
this URL: http://localhost:8080/tapestry-acegi/app

First I needed two pages (one secured):
* src/main/webapp/Home.html
* src/main/webapp/Secured.html 

Each of these pages is accompanied by a Java class:
* src/main/java/de/zedlitz/tapestry/acegi/Home.java 
* src/main/java/de/zedlitz/tapestry/acegi/Secured.java (This is the only
place where you have to specify that this page is secured!)

I have to tell Tapestry in which package to find the classes:
* src/main/webapp/WEB-INF/tapestry-acegi.application 

A standard webapplication setup for Tapestry and Spring:
* src/main/webapp/WEB-INF/web.xml 

The Spring configuration is also not spectacular. Every Spring enabled
application that uses Acegi has something like that.
* src/main/resources/applicationContext.xml

Only three beans are created here:
* memoryAuthenticationDao (In the example the username and password is
specified here. But of course you can put any complex bean here to retrieve
user information.)
* daoAuthenticationProvider
* authenticationManager


Now the interesting part - how to put it together:
* src/main/resources/META-INF/hivemodule.xml
* src/main/java/de/zedlitz/tapestry/acegi/UserDetailsServiceImpl.java

The service point "SpringApplicationInitializer" gives you access to
Spring's beans. I have written an implementation for the service
"hivemind.acegi.dao.UserDetailsService",
de.zedlitz.tapestry.acegi.UserDetailsServiceImpl that combines a Spring
UserDetailsService, the PasswordEncoder and the configured salt. From
hivemodule.xml:

  
   
 
 
 
   
  


The dependencies from pom.xml are probably also interesting:
* tapestry/tapestry-annotations 4.0.1
* tapestry/tapestry 4.0.1
* org.springframework/spring  1.2.6
* org.acegisecurity/acegi-security-tiger 1.0.1
* com.javaforge.tapestry/tapestry-spring  0.1.2
* com.javaforge.tapestry/tapestry-acegi  0.1-SNAPSHOT
* com.javaforge.hivemind/hivemind-acegi-dao  0.1-SNAPSHOT


I think that the solution could be made easier. My UserDetailsServiceImpl
class basicly forwards a UserDetails object. The encoding of the password
could be unnecessary if you could tell Hivemind to use a different
PasswordEncoder. 

Jesper

- -- 
 Jesper Zedlitz   eMail: [EMAIL PROTECTED]
  Homepage : http://www.zedlitz.de
  ICQ# : 23890711
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFEs1OgjSxW58yLxdgRAnqvAKDAfjpbyZPSLroWSK/xSWtVd6YwhACg63tF
U7a/UQZyLIf8IHXa0/WUV0o=
=vFNN
-END PGP SIGNATURE-


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]