Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9266255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:16:33+00:00 2026-06-18T14:16:33+00:00

Apache Shiro documentation implies some desired capabilities for trapping successive failed login attempts (among

  • 0

Apache Shiro documentation implies some desired capabilities for trapping successive failed login attempts (among others) however, I cannot find concrete documentation for this. Presently I can execute currentUser.login(token); with invalid pw infinite times and does not trap and throw this error. I am struggling to find where this is implemented in source.

Is this actually working? Is the threshold configured in shiro.ini? Can anyone point me to the documentation for this (or confirm that it doesn’t exist)?

Thanks

Environment Details: Shiro core 1.2.1 and jdbc realm

Begin Documentation
Step 3: Handling Success or Failure
If the login method returns quietly, that’s it – we’re done! The Subject has been authenticated. The application thread can continue uninterrupted and all further calls to SecurityUtils.getSubject() will return the authenticated Subject instance, and any calls to subject.isAuthenticated() will return true.

But what happens if the login attempt failed? For example, what if the end-user supplied an incorrect password, or accessed the system too many times and maybe their account is locked?

Shiro has a rich runtime AuthenticationException hierarchy that can indicate exactly why the attempt failed. You can wrap login in a try/catch block and catch any exception you wish and react to them accordingly. For example:

try {
    currentUser.login(token);
} catch ( UnknownAccountException uae ) { ...
} catch ( IncorrectCredentialsException ice ) { ...
} catch ( LockedAccountException lae ) { ...
} catch ( **ExcessiveAttemptsException** eae ) { ...
} ... catch your own ...
} catch ( AuthenticationException ae ) {
    //unexpected error?
}

//No problems, continue on as expected...

If one of the existing exception classes do not meet your needs, custom AuthenticationExceptions can be created to represent specific failure scenarios
//No problems, continue on as expected…
End Documentaion

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T14:16:34+00:00Added an answer on June 18, 2026 at 2:16 pm

    If you had simply googled for ExcessiveAttemptsException, in the second link you would have found the answer from Les Hazlewood, the author of shiro:

    Anyway, that exception exists but it is not thrown/managed at any
    point by Shiro. It is there for your use as a convenience so you
    don’t have to create your own Exception class if you don’t want to.
    You would need to instantiate and throw it in your Realm’s
    doGetAuthenticationInfo method when appropriate. The reason Shiro
    can’t do this automatically is that this type of logic (lock account
    after a certain number of times in a certain number of minutes) is
    usually entirely dependent upon your application’s User data model.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My application login is developed using Shiro Apache, it's working fine but now i
I am using Apache Shiro in a web-application. The login and authentication check works
In my web application that uses Apache Shiro for AuthC and AuthZ I have
I integrated Apache Shiro with a dummy user and it works just fine! But
Apache ODE documentation seems to support this i.e. invoking/orchestrating RESTFul APIs. No examples sources
I'm using Apache Shiro to secure my Spring MVC application. This is my config:
I want to use apache shiro to secure my JSF application that I have
I'm using Apache Shiro with a custom JDBC realm to retrieve a user’s salt,
We have a little problem with Apache Shiro. We are using Shiro with a
I am trying to use apache shiro into my project as I have to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.