wood burning stoves 2.0*
The moose likes Glassfish and the fly likes Java EE Security configuration not working. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Glassfish
Bookmark "Java EE Security configuration not working." Watch "Java EE Security configuration not working." New topic
Author

Java EE Security configuration not working.

chaitanya karthikk
Ranch Hand

Joined: Sep 15, 2009
Posts: 800

Hi all, I am trying to learn Java EE security. I configured security-constraint in web.xml file as
In glassfish server I have added 2 users in the file realms and also enabled "Default Principal To Role Mapping" option. But when I to tried to access any file under secure folder I could actually view it instead of being redirected to /public/login.jsp page.

Can anyone please explain me how to configure security in my web application.

Thank you all in advance. Good day.


Love all, trust a few, do wrong to none.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9924
    
158

Are you sure you are doing a POST? Your security configuration has been configured for only the POST method and will not be applied for GET and other methods.

[My Blog] [JavaRanch Journal]
chaitanya karthikk
Ranch Hand

Joined: Sep 15, 2009
Posts: 800

Thank you Jai for pointing the problem. I am doing a redirection from index.jsp. I included GET and it is working now.
 
 
subject: Java EE Security configuration not working.
 
Similar Threads
HTTP 403 for authenticated users - FIXED
Realm question
security-constraint login error
Form based authentication in java server faces.
Is auth-constraint related to security-role?