NoClassDefFoundError in Java is different from ClassNotFoundException and comes when Java Virtual Machine is not able to find a particular class at runtime which was available at compile time. See: 3 ways to solve java.lang.NoClassDefFoundError in Java J2EE
Check rt.jar in your Android studio project explorer : External Libraries -> <1.8> -> rt.jar -> javax -> security -> auth-> login -> . You can see FailedLoginException exist.
Now check External Libraries -> -> android.jar -> javax -> security -> auth-> login -> . You can see FailedLoginException Not exist.
It means your library compiled by rt.jar and now used with android.jar. In other side,
you cannot use rt.jar with an Android application (and somewhat overlaps with android.jar). because it is the runtime library for the desktop JRE, not Android. See : Android Studio - android.jar and rt.jar conflicts
Now to solve your problem you can Get the source code to the external library and rewrite it. See How to use classes from rt.jar in an android application?
I suggest to implement that class yourself with some debug function to avoid other dependent class implementation.
Another way which is not recommended is downloading a jar from here and adding it to your project.