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
Do note that Subject, which is the most likely class containing principals such as CallerPrincipal is indeed serializable.
As an example, this is how Tomcat (and Tomat derived web containers, such as in GlassFish and Payara) ultimately store the authenticated Principal;
/** * Set the Principal who has been authenticated for this Request. This * value is also used to calculate the value to be returned by the * <code>getRemoteUser()</code> method. * * @param principal The user Principal */@OverridepublicvoidsetUserPrincipal(Principalprincipal) {
if (SecurityUtil.isPackageProtectionEnabled()) {
HttpSessionsession = getSession(false);
if (subject != null && !subject.getPrincipals().contains(principal)) {
subject.getPrincipals().add(principal);
} elseif (session != null && session.getAttribute(SUBJECT_ATTR) == null) {
subject = newSubject();
subject.getPrincipals().add(principal);
}
if (session != null) {
session.setAttribute(SUBJECT_ATTR, subject);
}
}
this.callerPrincipal = principal;
}
The text was updated successfully, but these errors were encountered:
When auto apply session is used, it's highly likely (though not strictly specified as such) that the CallerPrincipal will end up in the HTTP session.
Items in the HTTP session must be serializable. Not doing that leads to errors such as reported here:
payara/Payara#3295
Do note that Subject, which is the most likely class containing principals such as CallerPrincipal is indeed serializable.
As an example, this is how Tomcat (and Tomat derived web containers, such as in GlassFish and Payara) ultimately store the authenticated Principal;
The text was updated successfully, but these errors were encountered: