Class JwtAuthCdiExtension
- java.lang.Object
-
- fish.payara.microprofile.jwtauth.cdi.JwtAuthCdiExtension
-
- All Implemented Interfaces:
jakarta.enterprise.inject.spi.Extension
public class JwtAuthCdiExtension extends Object implements jakarta.enterprise.inject.spi.Extension
This CDI extension installs theJWTAuthenticationMechanismand relatedSignedJWTIdentityStorewhen theLoginConfigannotation is encountered (MP-JWT 1.0 5).Additionally this extension checks that injection of claims are in the right scope (non-transitively, 7.1.3).
- Author:
- Arjan Tijms
-
-
Constructor Summary
Constructors Constructor Description JwtAuthCdiExtension()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> voidcheckInjectIntoRightScope(jakarta.enterprise.inject.spi.ProcessInjectionTarget<T> eventIn)<T> voidfindLoginConfigAnnotation(jakarta.enterprise.inject.spi.ProcessBean<T> eventIn)This method tries to find the LoginConfig annotation and if does flags that fact.<T> voidfindRoles(jakarta.enterprise.inject.spi.ProcessManagedBean<T> eventIn)Find all the roles used by the@RolesAllowedannotation, so these can be programmatically declared later on.Set<String>getRoles()voidinstallMechanismIfNeeded(jakarta.enterprise.inject.spi.AfterBeanDiscovery eventIn)booleanisAddJWTAuthenticationMechanism()voidregister(jakarta.enterprise.inject.spi.BeforeBeanDiscovery beforeBean, jakarta.enterprise.inject.spi.BeanManager beanManager)
-
-
-
Method Detail
-
register
public void register(@Observes jakarta.enterprise.inject.spi.BeforeBeanDiscovery beforeBean, jakarta.enterprise.inject.spi.BeanManager beanManager)
-
findLoginConfigAnnotation
public <T> void findLoginConfigAnnotation(@Observes jakarta.enterprise.inject.spi.ProcessBean<T> eventIn)This method tries to find the LoginConfig annotation and if does flags that fact.
-
findRoles
public <T> void findRoles(@Observes jakarta.enterprise.inject.spi.ProcessManagedBean<T> eventIn)Find all the roles used by the@RolesAllowedannotation, so these can be programmatically declared later on.
-
checkInjectIntoRightScope
public <T> void checkInjectIntoRightScope(@Observes jakarta.enterprise.inject.spi.ProcessInjectionTarget<T> eventIn)
-
installMechanismIfNeeded
public void installMechanismIfNeeded(@Observes jakarta.enterprise.inject.spi.AfterBeanDiscovery eventIn)
-
isAddJWTAuthenticationMechanism
public boolean isAddJWTAuthenticationMechanism()
-
-