Le 23 mai 2017 04:03, "chongma" <[email protected]> a écrit :
a few questions: - if i @Inject the java.security.Principal in the @ApplicationScoped i get an instance of org.apache.webbeans.custom.security.principal$$owbnormalscopeproxy0 which cannot be cast to UserPrincipal (a custom Jaas Principal), whereas httpServletRequest.getUserPrincipal can be cast to UserPrincipal Yes, opened a ticket on cdi spec to try to make this feature usable. Servlet one is castable since recently, mainly for jaspic iirc. - if i try @Produces UserPrincipal (a custom Jaas principal) it fails because it says there is already a producer for java.security.Principal Yes, use a custom qualifier - is there a way to call an isUserInRole function from an @ApplicationScoped that doesn't rely on httpServletRequest? i am going to try @RolesAllowed today Rolesallowed will work if you set up jaas realm but as mentionned best and reliable async way to impl any state is message passing pattern. -- View this message in context: http://tomee-openejb.979440. n4.nabble.com/Asynchronous-httpServletRequest-tp4681723p4681726.html Sent from the TomEE Users mailing list archive at Nabble.com.
