co.pablob.security.commons.boundary.JwtPrincipalProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kc Show documentation
Show all versions of kc Show documentation
Keycloak security to JEE using Soteria
The newest version!
package co.pablob.security.commons.boundary;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.security.enterprise.SecurityContext;
import co.pablob.security.commons.entity.JwtPrincipal;
@ApplicationScoped
public class JwtPrincipalProvider {
@Inject
@SuppressWarnings("CdiInjectionPointsInspection")
private SecurityContext securityContext;
public JwtPrincipal produceJwtPrincipal(){
return (JwtPrincipal) securityContext.getCallerPrincipal();
}
}