• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to handle a failed login

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a JAAS framework setup within my application and everything works well as long as you log in correctly. I have the typical setup:
try {
CallbackHandler callbackHandler = new LoginScreen();
LoginContext context = new LoginContext("AppName", callbackHandler);
context.login();
} catch (LoginException e) {
// The world blows up
}
So my CallbackHandler (LoginScreen) gets its array of callbacks. I pop up a little dialog and have the user enter in their username and password and then when they hit the ok button, I populate the appropriate callbacks, dispose of the dialog and then let the LoginModules do their little magic.
My problem is that I really don't want to close the dialog box unless they have either logged in correctly or logged in incorrectly 3 times. So how does my callback handler know whether the login succeeded or not? I can think of a million messy ways to accomplish this, but I was wondering if anyone had a clean solution to this problem?
Thanks,
-Phil
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic