@Produces
    @Principal
    @SuppressWarnings("unchecked")
    public static <T> Supplier<T> getPrincipal(InjectionPoint injectionPoint) {
        var parameterizedType = (ParameterizedType) injectionPoint.getType();
        var principalType = (Class<T>) parameterizedType.getActualTypeArguments()[0];
        SerializableSupplier<T> supplier = () -> SecurityUtils.getSubject().getPrincipals().oneByType(principalType);
        return supplier;
    }
Exposes Shiro's SecurityManager, Session and Subject via CDI @Inject
support/cdi/src/main/java/org/apache/shiro/cdi/ShiroComponentProducer.java