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 theJWTAuthenticationMechanism
and relatedSignedJWTIdentityStore
when theLoginConfig
annotation 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> void
checkInjectIntoRightScope(jakarta.enterprise.inject.spi.ProcessInjectionTarget<T> eventIn, jakarta.enterprise.inject.spi.BeanManager beanManager)
<T> void
findLoginConfigAnnotation(jakarta.enterprise.inject.spi.ProcessBean<T> eventIn, jakarta.enterprise.inject.spi.BeanManager beanManager)
This method tries to find the LoginConfig annotation and if does flags that fact.<T> void
findRoles(jakarta.enterprise.inject.spi.ProcessManagedBean<T> eventIn, jakarta.enterprise.inject.spi.BeanManager beanManager)
Find all the roles used by the@RolesAllowed
annotation, so these can be programmatically declared later on.Set<String>
getRoles()
void
installMechanismIfNeeded(jakarta.enterprise.inject.spi.AfterBeanDiscovery eventIn, jakarta.enterprise.inject.spi.BeanManager beanManager)
boolean
isAddJWTAuthenticationMechanism()
void
register(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, jakarta.enterprise.inject.spi.BeanManager beanManager)
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, jakarta.enterprise.inject.spi.BeanManager beanManager)
Find all the roles used by the@RolesAllowed
annotation, so these can be programmatically declared later on.
-
checkInjectIntoRightScope
public <T> void checkInjectIntoRightScope(@Observes jakarta.enterprise.inject.spi.ProcessInjectionTarget<T> eventIn, jakarta.enterprise.inject.spi.BeanManager beanManager)
-
installMechanismIfNeeded
public void installMechanismIfNeeded(@Observes jakarta.enterprise.inject.spi.AfterBeanDiscovery eventIn, jakarta.enterprise.inject.spi.BeanManager beanManager)
-
isAddJWTAuthenticationMechanism
public boolean isAddJWTAuthenticationMechanism()
-
-