Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Authentication attempts and the session...

 
Timothy Stone
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm playing with a servlet that is "protected" behind a BASIC authentication response.
The number of attempts are next to limitless, unless I set up an "attempts counter." Making it a private field is not an option as it crosses users, sessions, etc.
Putting the counter on the session seems the way to go. Anybody consider this a bad practice, best practice? And is the overhead of getting and setting the object on the session high?
TIA,
Tim
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
disclaimer: I'm thinking out loud.

The 'thing' that does the authentication is the Tomcat container. So you'd need to keep track of login attempts through BASIC auth through there, right?

Also.. is there such a thing as a Session before a user logs in? I know there is jsessionid when browsers don't have cookies. But BASIC auth happens (or should?) before this point. Or does it?

More questions.. no answers.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic