use of org.wildfly.security.auth.principal.AnonymousPrincipal in project wildfly by wildfly.
the class ForbidAnonymousInterceptor method processInvocation.
public Object processInvocation(final InterceptorContext context) throws Exception {
final SecurityDomain securityDomain = context.getPrivateData(SecurityDomain.class);
Assert.checkNotNullParam("securityDomain", securityDomain);
if (securityDomain.getCurrentSecurityIdentity().getPrincipal() instanceof AnonymousPrincipal) {
throw EjbLogger.EJB3_INVOCATION_LOGGER.ejbAuthenticationRequired();
} else {
return context.proceed();
}
}
Aggregations