How to use OIDC_CLAIM_* headers in Quarkus behind an Apache Reverse Proxy?

143 views Asked by At

I run Quarkus behind an Apache Reverse Proxy.
The Apache use mod_auth_openidc to authenticate the user and pass the OIDC_CLAIM_* HTTP headers to the applications behind.

How to configure Quarkus to read the OIDC_CLAIM_* HTTP headers ? Is there a way to @Inject this in the "quarkus" way ?

Here's the relevant HTTPD configuration :

<Location /java>
   ProxyPreserveHost On
   AuthType openid-connect
   Require claim resource_access.apache-oidc.roles:admin-role

   ProxyPass "http://java-app:8080"
   ProxyPassReverse "http://java-app:8080"
</Location>

Actually, the only way I have found using @HeaderParam

@GET
public String get(@HeaderParam("OIDC_CLAIM_preferred_username") String username) {
     return username;
}

It works but not the way it should. Can I use Quarkus to retrieve OIDC_* headers and access its content with the CDI ?

Thanks,

0

There are 0 answers