You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -550,9 +550,6 @@ public User login(HttpServletRequest request, HttpServletResponse response) thro
550
550
// save the current request and response in the threadlocal variables
551
551
setCurrentHTTP(request, response);
552
552
553
-
if ( !ESAPI.httpUtilities().isSecureChannel() ) {
554
-
newAuthenticationCredentialsException( "Session exposed", "Authentication attempt made over non-SSL connection. Check web.xml and server configuration" );
555
-
}
556
553
Useruser = null;
557
554
558
555
// if there's a user in the session then use that
@@ -567,31 +564,36 @@ public User login(HttpServletRequest request, HttpServletResponse response) thro
567
564
user.setFirstRequest(true);
568
565
}
569
566
567
+
// warn if this authentication request came over a non-SSL connection, exposing credentials or session id
568
+
if ( !ESAPI.httpUtilities().isSecureChannel() ) {
569
+
newAuthenticationCredentialsException( "Session or credentials exposed", "Authentication attempt made over non-SSL connection. Check web.xml and server configuration. User: " + user.getAccountName() );
570
+
}
571
+
570
572
// don't let anonymous user log in
571
573
if (user.isAnonymous()) {
572
574
user.logout();
573
-
thrownewAuthenticationLoginException("Login failed", "Anonymous user cannot be set to current user");
575
+
thrownewAuthenticationLoginException("Login failed", "Anonymous user cannot be set to current user. User: " + user.getAccountName() );
574
576
}
575
577
576
578
// don't let disabled users log in
577
579
if (!user.isEnabled()) {
578
580
user.logout();
579
581
user.setLastFailedLoginTime(newDate());
580
-
thrownewAuthenticationLoginException("Login failed", "Disabled user cannot be set to current user: " + user.getAccountName());
582
+
thrownewAuthenticationLoginException("Login failed", "Disabled user cannot be set to current user. User: " + user.getAccountName());
581
583
}
582
584
583
585
// don't let locked users log in
584
586
if (user.isLocked()) {
585
587
user.logout();
586
588
user.setLastFailedLoginTime(newDate());
587
-
thrownewAuthenticationLoginException("Login failed", "Locked user cannot be set to current user: " + user.getAccountName());
589
+
thrownewAuthenticationLoginException("Login failed", "Locked user cannot be set to current user. User: " + user.getAccountName());
588
590
}
589
591
590
592
// don't let expired users log in
591
593
if (user.isExpired()) {
592
594
user.logout();
593
595
user.setLastFailedLoginTime(newDate());
594
-
thrownewAuthenticationLoginException("Login failed", "Expired user cannot be set to current user: " + user.getAccountName());
596
+
thrownewAuthenticationLoginException("Login failed", "Expired user cannot be set to current user. User: " + user.getAccountName());
0 commit comments