Bug in FirstSuccessfulStrategy
authorlei.li <lileibh@gmail.com>
Mon, 29 Oct 2018 12:15:38 +0000 (20:15 +0800)
committerGitHub <noreply@github.com>
Mon, 29 Oct 2018 12:15:38 +0000 (20:15 +0800)
The '!' lost in the process of migration from 1.3.x to 1.4.0

core/src/main/java/org/apache/shiro/authc/pam/FirstSuccessfulStrategy.java

index 05b7010..6a99ff0 100644 (file)
@@ -57,7 +57,7 @@ public class FirstSuccessfulStrategy extends AbstractAuthenticationStrategy {
      * since this strategy mandates that only the info from the first successfully authenticated realm be used.
      */
     protected AuthenticationInfo merge(AuthenticationInfo info, AuthenticationInfo aggregate) {
-        if (aggregate != null && isEmpty(aggregate.getPrincipals())) {
+        if (aggregate != null && !isEmpty(aggregate.getPrincipals())) {
             return aggregate;
         }
         return info != null ? info : aggregate;