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_security Show documentation
Show all versions of kc_security Show documentation
Keycloak security to JEE using Soteria
The newest version!
package co.pablob.security.commons.boundary;
import co.pablob.security.commons.entity.JwtPrincipal;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Produces;
import javax.inject.Inject;
import javax.security.enterprise.SecurityContext;
public class JwtPrincipalProvider {
@Inject
private SecurityContext securityContext;
@Produces
@RequestScoped
public JwtPrincipal produceJwtPrincipal(){
return securityContext.getPrincipalsByType(JwtPrincipal.class)
.toArray(new JwtPrincipal[0])[0];
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy