jwtquarkussmallrye

Access request headers from JWTCallerPrincipalFactory


I am using Quarkus with quarkus-smallrye-jwt and I want to access the request headers from a custom subclass of JWTCallerPrincipalFactory as explained by https://quarkus.io/guides/security-jwt#custom-factories. Is there a way to do that?


Solution

  • I solved it by using an implementation of HttpAuthenticationMechanism which has access to the RoutingContext as described here https://quarkus.io/guides/security-customization#httpauthenticationmechanism-customization