Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jdbcRealm. Suddenly can't get access

 
camilla camilla
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have implementet formAuthentication and jdbcRealm by subclassing jdbcRealm since I have my own db-structure with users and roles. This seems to work fine. In my loginpage I use j_security:
<form method="POST" action="j_security">
<input type="text" name="j_username" />
<input type="text" name="j_username" />
 
camilla camilla
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
upps... deidn't mean to sendt it yet..
Again:

I have implementet formAuthentication and jdbcRealm by subclassing jdbcRealm since I have my own db-structure with users and roles. This seems to work fine. In my loginpage I use j_security:
<form method="POST" action="j_security">
<input type="text" name="j_username" />
<input type="text" name="j_username" />
</form>

I have defines roles in the web.xml file and have different accesslevels to different folders. This also seems to work fine, since I can login as I want to with correct roles and users.
But the problem occurs when I logout and want to login again.

In my logout I have the following code:
session.invalidate();
response.sendRedirect("index.jsp");

The logou works fine, but if I relogin I get access denied error:
403 - access to the specified resource has been forbidden.
If I close the browser and try again it works fine. So I have to close the browser before logging in with the same or a different user. And worse, this happens only once and a while.

Has somebody seen something similar. I can't figure out the problem. I'm mainly using JSF technology, but jsp for the loginpage because of the j_security.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic