Results 1 to 3 of 3

Thread: Form Authorization doesnt work with POST

  1. #1
    Join Date
    Jul 2008
    Posts
    5

    Default Form Authorization doesnt work with POST

    Have anybody some tip, why my authorization form doesnt work with method="post" but it works with method="get"?

    (with post method userdetailservice obtains empty string)

    thx

  2. #2
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    Form authentication should work with POST. Indeed the spring-security-samples-tutorial has a login.jsp which shows this (extract):

    Code:
        <form name="f" action="<c:url value='j_spring_security_check'/>" method="POST">
          <table>
            <tr><td>User:</td><td><input type='text' name='j_username'></td></tr>
            <tr><td>Password:</td><td><input type='password' name='j_password'></td></tr>
            <tr><td><input type="checkbox" name="_spring_security_remember_me"></td><td>Don't ask for my password for two weeks</td></tr>
    
            <tr><td colspan='2'><input name="submit" type="submit"></td></tr>
            <tr><td colspan='2'><input name="reset" type="reset"></td></tr>
          </table>
    
        </form>
    Are you providing an unusual form encoding (eg enctype is multipart), or failing to POST to j_spring_security_check?
    Ben Alex
    Project Founder, Spring UAA, Spring Roo and Spring Security

  3. #3
    Join Date
    Jul 2008
    Posts
    5

    Default grr

    You are right. Problem was with enctype="text/plain" which my text editor automagicaly add.

    Solved, thank you.

Posting Permissions

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