Hi Darin,

I think the code is fine.
The code iterates over the realms and tries to create an Account for each
of them.
For the first successful authentication it assigns it to 'firstAccount'.
For the second realm it creates a DefaultCompositeAccount from the
firstAccount and appends the second. For the third and all following it
just appends.

https://github.com/apache/shiro/blob/2.0-api-design-changes/core/src/main/java/org/apache/shiro/authc/strategy/AtLeastOneRealmSuccessfulStrategy.java

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Sun, Apr 26, 2015 at 3:34 PM, Darin Gordon <[email protected]> wrote:

> within the execute method:
>
> line 70 will append the first realm and its corresponding account a second
> time
>
>  61                 if (account != null) {
>
>  62                     if (firstAccount == null) {
>
>  63                         firstAccount = account;
>
>  64                         firstAccountRealmName = realmName;
>
>  65                     } else {
>
>  66                         if (compositeAccount == null) {
>
>  67                             compositeAccount = new
> DefaultCompositeAccount();
>  68
> compositeAccount.appendRealmAccount(firstAccountRealmName, firstAccount);
>  69                         }
>
>  70                         compositeAccount.appendRealmAccount(realmName,
> account);
>  71                     }
>
>  72                 }
>
>
> -DG
>

Reply via email to