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 has been 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.
The text was updated successfully, but these errors were encountered:
This happened to me on the first visit to a site after switching my application's realm from IniRealm to ApplicationRealm, because it still had the cookie from the previous login. (Or, I assume that's the explanation, because visiting in incognito mode worked and then clearing the cookie and refreshing worked.) I understand what happened, but the NoSuchElementException stack trace in the logs did not point me in the right direction.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
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.
The text was updated successfully, but these errors were encountered: