soteria
soteria copied to clipboard
Principal obtained from EJBContext should be returned even if not assignable from CallerPrincipal
SubjectParser is not returning custom principals from EJBContext. SecurityContext.getCallerPrincipal delegates to EJBContext.getCallerPrincipal which obtains the custom principal correctly. This principal is then not returned because it is not of CallerPrincipal type here.
A custom principal from EJBContext should be returned whether it is of type CallerPrincipal or not, since there is no requirement for the principal from EJBContext to be CallerPrincipal.