| Author |
login manually using LoginContext is not stored on the session for a security constraint
|
Elico Av
Greenhorn
Joined: Dec 19, 2010
Posts: 6
|
|
Hi,
I have a custom login module:
I have a jaas.login:
TomcatTest {
com.tomcat.test.security.CustomLoginModule required debug=true;
};
In my web.xml I have:
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>TomcatTest</realm-name>
</login-config>
<security-role>
<role-name>admin</role-name>
</security-role>
<security-constraint>
<web-resource-collection>
<web-resource-name>all</web-resource-name>
<url-pattern>/secured/*</url-pattern>
<http-method>HEAD</http-method>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>DELETE</http-method>
<http-method>PUT</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
When I go to a URL /secured/secured.html I get the login popup and everything works well.
I tried to implement a different servlet (not secured) and perform a manual login:
And I also created the CustomCallbackHandler:
In the LoginServlet the login is successfull, but when from the same browser I go to /secured/secured.html I still get the login popup from the browser.
It seems that the session does not 'remember' the manual login.
Can someone please tell me what I am doing wrong? I don't know what else to do
Thank you very much for your assistance.
|
 |
 |
|
|
subject: login manually using LoginContext is not stored on the session for a security constraint
|
|
|