users@glassfish.java.net

Re: creating datasource, realm, login-module in application

From: <glassfish_at_javadesktop.org>
Date: Thu, 11 Sep 2008 13:40:34 PDT

thanks that worked. Now i created servlet called testServlet which is a protected resource. So i defined

<security-constraint>
    <web-resource-collection>
      <web-resource-name>test</web-resource-name>
      <url-pattern>/DeployServlet/*</url-pattern>
      <url-pattern>/FileUploadServlet</url-pattern>
    </web-resource-collection>
    <auth-constraint>
      <role-name>account-owner</role-name>
    </auth-constraint>
  </security-constraint>

  <login-config>
    <auth-method>BASIC</auth-method>
    <realm-name>xyz</realm-name>
  </login-config>

...

So when i access the test servlet its authenticating properly. However, whenever i access through browser it calls the authentication everytime. Why is that? How do i tell to the container do authenticate only once and not every time?
[Message sent by forum member 'eligetiv' (eligetiv)]

http://forums.java.net/jive/thread.jspa?messageID=298883