Unfortunately we cannot simply add {{KeycloakPrincipal}} to the set of types of {{Principal}} bean, because {{KeycloakPrincipal}} is not proxyable type. Possible workarounds are: # create producer with JNDI lookup which will return {{@Dependent KeycloPrincipal KeycloakPrincipal }} # use directly {{WeldManager.getServices().get(SecurityServices.class).getPrincipal()}} # introduce {{WeldPrincipal}} bean with something like "unwrap" method which will do the same as in 2) |
|