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
{{ message }}
This repository was archived by the owner on Dec 12, 2018. It is now read-only.
I have an application that uses multiple Realms (in this particular case an IniRealm and the ApplicationRealm). ApplicationRealm.getAccountHref() assumes that the subject was authenticated against the ApplicationRealm
protected String getAccountHref(PrincipalCollection principals) {
Collection c = principals.fromRealm(getName());
//Based on the createPrincipals implementation above, the first one is the Account href:
return (String) c.iterator().next();
}
When a PrincipalCollection is passed to doGetAuthorizationInfo, the c.size() == 0 so there is no next().
java.util.NoSuchElementException
at java.util.Collections$EmptyIterator.next(Collections.java:3006)
Trapping an empty collection and returning a default/empty SimpleAuthorizationInfo seems the most appropriate solution but that's just a guess.