Results 1 to 5 of 5

Thread: propogate request params through login page?

  1. #1

    Default propogate request params through login page?

    My application needs to allow anonymous users to fill out a form, but require them to log in when they submit the form. (The form target is the protected resource.) The original form request params are lost since it is a different request after login form submit.

    I thought I could use a dynamic list of hidden fields on the form page to resubmit the form values, but the request params are gone by the time it hits the login page. *poof* (And even if I could do that, I dont think that is the best way.)

    Any ideas?


    Thank you,
    Dan

  2. #2
    Join Date
    Jun 2005
    Posts
    2

    Default Passing Form Values Through Login

    I too am interested in a solution for this problem. I am submitting a *session* scoped Struts DynaActionForm to a protected area which then requires authentication. After submitting the login form, the value contained by the Struts form is blank.

    Any tips would be greatly apprecitated. Thanks!

  3. #3
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    Does the same thing happen if you use a GET request to submit the (initial) form, rather than POST (assuming that's feasible)?

    The current implementation doesn't translate POST parameters into a URL query string when it is redirecting to the original target after a successful login.

    Luke.

  4. #4

    Default

    Thank you for a reply Luke.

    I tried with GET and that does correctly pass the parameters around. For all my current use cases, GET will work technically, but I regret changing my beautiful, clean url structure to a long confusing one passing those parameters around. (A marketing "requirement" for our site is short clean URLs, and this would have to use GET form submissions through most of the site. :-/ )

    It also requires changes to controllers that extend the Spring SimpleFormController, etc that use the GET vs POST distinction for processing pages.

    Would the eventual solution be to internally translate from POST -> GET params? That doesnt seem like the best solution. I was thinking that I could printout the POST params into hidden fields on the login form and resubmit as a POST, but surprisingly to me the login page itself has already lost the POST params (not just the forwarded to page).

    Thanks again for any thoughts and suggestions. I'll hapily contribute some code to the project if the minds that be have a suggested patch.

  5. #5
    Join Date
    Jun 2005
    Posts
    2

    Default Thank you, Luke!

    Luke, converting from POST to GET did the trick. After looking at the thing so many times, I couldn't see the forest for the trees. Thanks for your help.

Similar Threads

  1. Replies: 17
    Last Post: Jan 2nd, 2007, 01:43 PM
  2. Pageable data list with Hibernate
    By robmorgan in forum Data
    Replies: 23
    Last Post: Jul 24th, 2006, 06:12 PM
  3. Replies: 9
    Last Post: Nov 1st, 2005, 10:36 PM
  4. Replies: 3
    Last Post: Sep 22nd, 2005, 10:14 AM
  5. Replies: 0
    Last Post: Aug 30th, 2005, 08:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •