This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 9317
    
109

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java EE Security configuration not working.
 
Similar Threads
security-constraint login error
Form based authentication in java server faces.
Is auth-constraint related to security-role?
HTTP 403 for authenticated users - FIXED
Realm question