Announcement

Collapse
No announcement yet.

Form-based Authentication" in Tomcat

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Form-based Authentication" in Tomcat

    hi. ich müsste einen login bereich auf einer website machen. habe einstweilen infos bekommen, dass ich dies am besten mit "Form-based Authentication" in Tomcat umsetze. leider bin ich noch nicht schlauer geworden, könnt ihr mir bitte weiterhelfen!

  • #2
    kennt das wirklich niemand? bin schon am verzweifeln..

    Comment


    • #3
      dazu musst du die web.xml veränder

      Comment


      • #4
        <security-constraint>
        <web-resource-collection>
        <web-resource-name>SecurePages</web-resource-name>
        <description>Security constraint /secure</description>
        <url-pattern>/secure/*</url-pattern>
        <http-method>POST</http-method>
        <http-method>GET</http-method>
        </web-resource-collection>
        <auth-constraint>
        <description>only let the admin users login</description>
        <role-name>admin</role-name>
        </auth-constraint>
        </security-constraint>

        <security-role>
        <description>The Only Secure Role</description>
        <role-name>admin</role-name>
        </security-role>

        <login-config>
        <auth-method>FORM</auth-method>
        <form-login-config>
        <form-login-page>/LoginForm.html</form-login-page>
        <form-error-page>/LoginError.html</form-error-page>
        </form-login-config>
        </login-config>

        <form method="POST" action="j_security_check">

        Username: <input type="text" name="j_username"><br />
        Password: <input type="password" name="j_password"><br />
        <br />

        <input type="submit" value="Login">
        <input type="reset" value="Reset">

        </form&gt

        Comment


        • #5
          &lt;form method="POST" action="j_security_check"&gt;

          Username: &lt;input type="text" name="j_username"&gt; &lt;br /&gt;
          Password: &lt;input type="password" name="j_password"&gt; &lt;br /&gt;
          &lt;br /&gt;

          &lt;input type="submit" value="Login"&gt;
          &lt;input type="reset" value="Reset"&gt;

          &lt;/form&gt

          Comment


          • #6
            beispie

            Comment


            • #7
              sorry hatte vergessen zu posten dass alles einwandfrei funktioniert ;_

              Comment

              Working...
              X