Re: Re: Re: tapestry-acegi questions

2006-11-16 Thread Robin Ericsson

On 11/14/06, Robin Ericsson [EMAIL PROTECTED] wrote:

Hmm, no, never though of that, might be a good idea though. I'll see
if I have time to try this today.


Ok, debugged and problem found. Safari seems to like to cache the
result of the first query to the protected page.

I was using a proxy called Charles (really good app btw) and when
disable caching the result to the browser contained header Expires:
0. Probably it's just that easy to add that header manually when
redirecting from protected page to login page, I'll try that another
time.

--
   regards,
   Robin

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



Re: Re: tapestry-acegi questions

2006-11-14 Thread Robin Ericsson

On 11/12/06, Robin Ericsson [EMAIL PROTECTED] wrote:

Thanks to James again :), I have a working solution that redirects
after successful login. However, on Firefox it works like a charm, but
on Safari it doesn't work as it seems it doesn't process cookies or
something the same way.


Maybe I should take this to Acegi directly instead?

--
   regards,
   Robin

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



Re: Re: tapestry-acegi questions

2006-11-14 Thread James Carman

Oh, sorry, Robin.  I read your last email, but only through the
thanks, I've got it working part. :-)  I didn't see the questions at
the bottom.  Do you have something that will let you debug the HTTP
traffic?  That might help you see what's going on for sure.


On 11/14/06, Robin Ericsson [EMAIL PROTECTED] wrote:

On 11/12/06, Robin Ericsson [EMAIL PROTECTED] wrote:
 Thanks to James again :), I have a working solution that redirects
 after successful login. However, on Firefox it works like a charm, but
 on Safari it doesn't work as it seems it doesn't process cookies or
 something the same way.

Maybe I should take this to Acegi directly instead?

--
regards,
Robin

-
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: Re: tapestry-acegi questions

2006-11-14 Thread Robin Ericsson

On 11/14/06, James Carman [EMAIL PROTECTED] wrote:

Oh, sorry, Robin.  I read your last email, but only through the
thanks, I've got it working part. :-)  I didn't see the questions at
the bottom.  Do you have something that will let you debug the HTTP
traffic?  That might help you see what's going on for sure.


Hmm, no, never though of that, might be a good idea though. I'll see
if I have time to try this today.

--
   regards,
   Robin

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



Re: Re: tapestry-acegi questions

2006-11-12 Thread Robin Ericsson

On 11/10/06, James Carman [EMAIL PROTECTED] wrote:

You could use a callback somehow to do that, I would think.  But, you
would probably have to implement the auto-redirect-to-login-page logic
yourself, so that you could save the callback into the session or set
it on the login page as a property or something.


Thanks to James again :), I have a working solution that redirects
after successful login. However, on Firefox it works like a charm, but
on Safari it doesn't work as it seems it doesn't process cookies or
something the same way.

Firefox:
anon: securedpage - login redirect
anon: login successful - securepage redirect
loggedin: securepage

Safari
anon: securedpage - login redirect
anon: login successful - securepage redirect
still anon: securepage - login redirect
loggedin: when landing on login page

My authenticationProcessingFilter looks like this.
http://pastebin.com/822425

The attemptAuthentication(String, String) is called from my tapestry
listener. Maybe I need to flush the http response or something? Or
maybe I need to tell tapestry to step processing?


--
   regards,
   Robin

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



RE: Re: tapestry-acegi questions

2006-11-01 Thread Thomas.Vaughan
Acegi's AuthenticationProcessingFilter is, by default, coded to
intercept any web request to j_acegi_security_check.  You can override
the actual name of the servlet with the filterProcessesUrl parameter of
that class.

So all you need to do to link Tapestry and Acegi is just throw a
RedirectException in your Login.java Tapestry page to the
j_acegi_security_check url and the Acegi filter pipeline should pick it
up, parse out the username  password, hand it off to the
authenticationManager, etc. etc.

If you're not getting that behavior, make sure your web.xml has this
filter and filter-mapping section:

filter
filter-nameAcegi Filter Chain Proxy/filter-name
 
filter-classorg.acegisecurity.util.FilterToBeanProxy/filter-class
init-param
param-nametargetClass/param-name
 
param-valueorg.acegisecurity.util.FilterChainProxy/param-value
/init-param
/filter
 

filter-mapping
filter-nameAcegi Filter Chain Proxy/filter-name
url-pattern/*/url-pattern
/filter-mapping


===

FYI, here's some Login.java code that backs my Tapestry page (the
username and password params are abstract getters a la Tapestry form
bindings, abnd the cipherText method just encodes the password using a
non-salted MD5 hash):

public void login(IRequestCycle cycle) throws RedirectException {
String ciphertext = getCipherText(getPassword());

LOG.debug(User  + getUsername() +  is attempting login.);
String acegiUrl = cycle.getAbsoluteURL(
/j_acegi_security_check?j_username= +
getUsername() +
j_password= +
ciphertext);


throw new RedirectException(acegiUrl);  
}   

===

Tom

-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Jesper Zedlitz
Sent: Wednesday, November 01, 2006 8:52 AM
To: users@tapestry.apache.org
Subject: Re: tapestry-acegi questions

James Carman wrote:
 I haven't implemented form-based authentication in
 tapestry-acegi, yet.  But, I don't think it's that difficult, really.
 Your need to use the AuthenticationProcessingFilter (I don't define it
 in my hivemodule.xml, but it would be easy to do so in yours) and your
 form has to have two fields named j_username and j_password and it
 should post to j_acegi_security_check.  The filter will pick up that
 request and handle it.  You would override the symbol
 tapestry.acegi.authenticationProcessingFilter to point to your
 authentication filter 

I have added these entries to my hivemodule.xml:

contribution configuration-id=hivemind.ApplicationDefaults
  default symbol=tapestry.acegi.authenticationProcessingFilter
   value=de.zedlitz.tapestry.acegi.FormProcessingFilter/
  default symbol=tapestry.acegi.authenticationEntryPoint
 
value=de.zedlitz.tapestry.acegi.FormAuthenticationEntryPoint/
  !-- 
 you have to adjust this text according to your module id
--
/contribution

service-point id=FormProcessingFilter
interface=javax.servlet.Filter
  invoke-factory
construct
class=org.acegisecurity.ui.webapp.AuthenticationProcessingFilter
 initialize-method=afterPropertiesSet
  set property=authenticationFailureUrl
value=/LoginFailed.html/
  set property=defaultTargetUrl value=/app/
  set property=filterProcessesUrl
value=/j_acegi_security_check/
/construct
  /invoke-factory
/service-point

service-point id=FormAuthenticationEntryPoint  
 
interface=org.acegisecurity.ui.AuthenticationEntryPoint
  invoke-factory
construct
class=org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPo
int
  set property=loginFormUrl
   value=/app?page=Loginamp;service=page/
  set property=forceHttps value=false/
/construct
  /invoke-factory
/service-point

and created Login.html and Login.java according to the tutorial
http://wiki.javascud.org/display/hsa/Acegi+and+Tapestry--A+Step-by-Step+
Guide

When I try to access a secured page it works fine and I get to the login
page. After submitting the login form I will be redirected
to /j_acegi_security_check 
But how do I wire this URL to Acegi?


Jesper



-
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: Re: tapestry-acegi questions

2006-11-01 Thread James Carman

With Tapestry-Acegi, we're not using the Acegi servlet filter.

On 11/1/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

Acegi's AuthenticationProcessingFilter is, by default, coded to
intercept any web request to j_acegi_security_check.  You can override
the actual name of the servlet with the filterProcessesUrl parameter of
that class.

So all you need to do to link Tapestry and Acegi is just throw a
RedirectException in your Login.java Tapestry page to the
j_acegi_security_check url and the Acegi filter pipeline should pick it
up, parse out the username  password, hand it off to the
authenticationManager, etc. etc.

If you're not getting that behavior, make sure your web.xml has this
filter and filter-mapping section:

filter
filter-nameAcegi Filter Chain Proxy/filter-name

filter-classorg.acegisecurity.util.FilterToBeanProxy/filter-class
init-param
param-nametargetClass/param-name

param-valueorg.acegisecurity.util.FilterChainProxy/param-value
/init-param
/filter


filter-mapping
filter-nameAcegi Filter Chain Proxy/filter-name
url-pattern/*/url-pattern
/filter-mapping


===

FYI, here's some Login.java code that backs my Tapestry page (the
username and password params are abstract getters a la Tapestry form
bindings, abnd the cipherText method just encodes the password using a
non-salted MD5 hash):

public void login(IRequestCycle cycle) throws RedirectException {
String ciphertext = getCipherText(getPassword());

LOG.debug(User  + getUsername() +  is attempting login.);
String acegiUrl = cycle.getAbsoluteURL(
/j_acegi_security_check?j_username= +
getUsername() +
j_password= +
ciphertext);


throw new RedirectException(acegiUrl);
}

===

Tom

-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Jesper Zedlitz
Sent: Wednesday, November 01, 2006 8:52 AM
To: users@tapestry.apache.org
Subject: Re: tapestry-acegi questions

James Carman wrote:
 I haven't implemented form-based authentication in
 tapestry-acegi, yet.  But, I don't think it's that difficult, really.
 Your need to use the AuthenticationProcessingFilter (I don't define it
 in my hivemodule.xml, but it would be easy to do so in yours) and your
 form has to have two fields named j_username and j_password and it
 should post to j_acegi_security_check.  The filter will pick up that
 request and handle it.  You would override the symbol
 tapestry.acegi.authenticationProcessingFilter to point to your
 authentication filter

I have added these entries to my hivemodule.xml:

contribution configuration-id=hivemind.ApplicationDefaults
  default symbol=tapestry.acegi.authenticationProcessingFilter
   value=de.zedlitz.tapestry.acegi.FormProcessingFilter/
  default symbol=tapestry.acegi.authenticationEntryPoint

value=de.zedlitz.tapestry.acegi.FormAuthenticationEntryPoint/
  !--
 you have to adjust this text according to your module id
--
/contribution

service-point id=FormProcessingFilter
interface=javax.servlet.Filter
  invoke-factory
construct
class=org.acegisecurity.ui.webapp.AuthenticationProcessingFilter
 initialize-method=afterPropertiesSet
  set property=authenticationFailureUrl
value=/LoginFailed.html/
  set property=defaultTargetUrl value=/app/
  set property=filterProcessesUrl
value=/j_acegi_security_check/
/construct
  /invoke-factory
/service-point

service-point id=FormAuthenticationEntryPoint

interface=org.acegisecurity.ui.AuthenticationEntryPoint
  invoke-factory
construct
class=org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPo
int
  set property=loginFormUrl
   value=/app?page=Loginamp;service=page/
  set property=forceHttps value=false/
/construct
  /invoke-factory
/service-point

and created Login.html and Login.java according to the tutorial
http://wiki.javascud.org/display/hsa/Acegi+and+Tapestry--A+Step-by-Step+
Guide

When I try to access a secured page it works fine and I get to the login
page. After submitting the login form I will be redirected
to /j_acegi_security_check
But how do I wire this URL to Acegi?


Jesper



-
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: Re: tapestry-acegi questions

2006-11-01 Thread Thomas.Vaughan
Ohhh...sorry 'bout that.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of James
Carman
Sent: Wednesday, November 01, 2006 9:08 AM
To: Tapestry users
Subject: Re: Re: tapestry-acegi questions

With Tapestry-Acegi, we're not using the Acegi servlet filter.

On 11/1/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Acegi's AuthenticationProcessingFilter is, by default, coded to
 intercept any web request to j_acegi_security_check.  You can override
 the actual name of the servlet with the filterProcessesUrl parameter
of
 that class.

 So all you need to do to link Tapestry and Acegi is just throw a
 RedirectException in your Login.java Tapestry page to the
 j_acegi_security_check url and the Acegi filter pipeline should pick
it
 up, parse out the username  password, hand it off to the
 authenticationManager, etc. etc.

 If you're not getting that behavior, make sure your web.xml has this
 filter and filter-mapping section:

 filter
 filter-nameAcegi Filter Chain Proxy/filter-name

 filter-classorg.acegisecurity.util.FilterToBeanProxy/filter-class
 init-param
 param-nametargetClass/param-name

 param-valueorg.acegisecurity.util.FilterChainProxy/param-value
 /init-param
 /filter


 filter-mapping
 filter-nameAcegi Filter Chain Proxy/filter-name
 url-pattern/*/url-pattern
 /filter-mapping


 ===

 FYI, here's some Login.java code that backs my Tapestry page (the
 username and password params are abstract getters a la Tapestry form
 bindings, abnd the cipherText method just encodes the password using a
 non-salted MD5 hash):

 public void login(IRequestCycle cycle) throws RedirectException {
 String ciphertext = getCipherText(getPassword());

 LOG.debug(User  + getUsername() +  is attempting login.);
 String acegiUrl = cycle.getAbsoluteURL(
 /j_acegi_security_check?j_username= +
 getUsername() +
 j_password= +
 ciphertext);


 throw new RedirectException(acegiUrl);
 }

 ===

 Tom

 -Original Message-
 From: news [mailto:[EMAIL PROTECTED] On Behalf Of Jesper Zedlitz
 Sent: Wednesday, November 01, 2006 8:52 AM
 To: users@tapestry.apache.org
 Subject: Re: tapestry-acegi questions

 James Carman wrote:
  I haven't implemented form-based authentication in
  tapestry-acegi, yet.  But, I don't think it's that difficult,
really.
  Your need to use the AuthenticationProcessingFilter (I don't define
it
  in my hivemodule.xml, but it would be easy to do so in yours) and
your
  form has to have two fields named j_username and j_password and
it
  should post to j_acegi_security_check.  The filter will pick up
that
  request and handle it.  You would override the symbol
  tapestry.acegi.authenticationProcessingFilter to point to your
  authentication filter
 
 I have added these entries to my hivemodule.xml:

 contribution configuration-id=hivemind.ApplicationDefaults
   default symbol=tapestry.acegi.authenticationProcessingFilter
value=de.zedlitz.tapestry.acegi.FormProcessingFilter/
   default symbol=tapestry.acegi.authenticationEntryPoint

 value=de.zedlitz.tapestry.acegi.FormAuthenticationEntryPoint/
   !--
  you have to adjust this text according to your module id
 --
 /contribution

 service-point id=FormProcessingFilter
 interface=javax.servlet.Filter
   invoke-factory
 construct
 class=org.acegisecurity.ui.webapp.AuthenticationProcessingFilter
  initialize-method=afterPropertiesSet
   set property=authenticationFailureUrl
 value=/LoginFailed.html/
   set property=defaultTargetUrl value=/app/
   set property=filterProcessesUrl
 value=/j_acegi_security_check/
 /construct
   /invoke-factory
 /service-point

 service-point id=FormAuthenticationEntryPoint

 interface=org.acegisecurity.ui.AuthenticationEntryPoint
   invoke-factory
 construct

class=org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPo
 int
   set property=loginFormUrl
value=/app?page=Loginamp;service=page/
   set property=forceHttps value=false/
 /construct
   /invoke-factory
 /service-point

 and created Login.html and Login.java according to the tutorial

http://wiki.javascud.org/display/hsa/Acegi+and+Tapestry--A+Step-by-Step+
 Guide

 When I try to access a secured page it works fine and I get to the
login
 page. After submitting the login form I will be redirected
 to /j_acegi_security_check
 But how do I wire this URL to Acegi?


 Jesper



 -
 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

Re: Re: tapestry-acegi questions

2006-10-30 Thread Gareth
hi,

I'm using the TableView component on what can be visulised as a search page.

The whole page is wrapped in a form (so that the paging buttons etc submit the 
search criteria), and the Form version of TableRow and TablePages are used.  
Everything appears to work except... I have 2 gripes that I can't seem to get 
around.

1. The entire page is wrapped in a form from within my Border component, which 
I didn't want to do because I had a seperate Login form at the top of my page, 
however failure to do so causes a rewind exception on the table because it cant 
create the same table model I guess - any suggestions as to how I can 
essentially prevent the table rewinding in this circumstance (I hide it on the 
next page render).

2. When I click on search, the search crieria are used to populate the table 
with its table model, working just fine, however, if I move to say page 3 of 
the table, then search again, the paging defaults to page 3 of the new search 
results... how do I reset the paging component to page 1 in this scenario?

Many Thanks

Gareth

Send instant messages to your online friends http://uk.messenger.yahoo.com

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



Re: Re: tapestry-acegi questions

2006-10-30 Thread Robin Ericsson

On 10/30/06, Gareth [EMAIL PROTECTED] wrote:

hi,

I'm using the TableView component on what can be visulised as a search page.


Hi,

Please don't steal other threads with a new question.

--
   regards,
   Robin

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



Re: Re: tapestry-acegi questions

2006-10-29 Thread Robin Ericsson

On 10/29/06, James Carman [EMAIL PROTECTED] wrote:

Hi, Robin.  I haven't implemented form-based authentication in
tapestry-acegi, yet.  But, I don't think it's that difficult, really.
Your need to use the AuthenticationProcessingFilter (I don't define it
in my hivemodule.xml, but it would be easy to do so in yours) and your
form has to have two fields named j_username and j_password and it
should post to j_acegi_security_check.  The filter will pick up that
request and handle it.  You would override the symbol
tapestry.acegi.authenticationProcessingFilter to point to your
authentication filter (like it does by default with the HTTP BASIC
filter).  If you get it working, feel free to email me snippets from
your hivemodule.xml and I'll make sure I include it in the default one
so that everyone can benefit.  If I were going to do it, I'd make sure
that the URL (j_acegi_security_check) is configurable as a symbol,
also.  We'd want a cool way to set up the URLs and stuff, too.  Good
luck and keep us posted!


Ok, seems fine. Another easy question though, how do I post to
j_acegi_security_check, tapestry overrides action field?

--
   regards,
   Robin

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



Re: Re: tapestry-acegi questions

2006-10-29 Thread Shing Hing Man
Step C at the following might help.

http://wiki.javascud.org/display/hsa/Acegi+and+Tapestry--A+Step-by-Step+Guide

shing


--- Robin Ericsson [EMAIL PROTECTED] wrote:

 On 10/29/06, James Carman
 [EMAIL PROTECTED] wrote:
  Hi, Robin.  I haven't implemented form-based
 authentication in
  tapestry-acegi, yet.  But, I don't think it's that
 difficult, really.
  Your need to use the
 AuthenticationProcessingFilter (I don't define it
  in my hivemodule.xml, but it would be easy to do
 so in yours) and your
  form has to have two fields named j_username and
 j_password and it
  should post to j_acegi_security_check.  The
 filter will pick up that
  request and handle it.  You would override the
 symbol
  tapestry.acegi.authenticationProcessingFilter to
 point to your
  authentication filter (like it does by default
 with the HTTP BASIC
  filter).  If you get it working, feel free to
 email me snippets from
  your hivemodule.xml and I'll make sure I include
 it in the default one
  so that everyone can benefit.  If I were going to
 do it, I'd make sure
  that the URL (j_acegi_security_check) is
 configurable as a symbol,
  also.  We'd want a cool way to set up the URLs and
 stuff, too.  Good
  luck and keep us posted!
 
 Ok, seems fine. Another easy question though, how do
 I post to
 j_acegi_security_check, tapestry overrides action
 field?
 
 -- 
 regards,
 Robin
 

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


Home page :
  http://uk.geocities.com/matmsh/index.html

Send instant messages to your online friends http://uk.messenger.yahoo.com 

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