I've successfully provisioned apache web server using mod_auth_openidc to protect our internal dashboards, using Auth0 and Google App Oauth, described in this documentation: - https://github.com/zmartzone/mod_auth_openidc#openid-connect-sso-with-google-sign-in - https://auth0.com/docs/quickstart/webapp/apache/01-login (without using auth0 rule pipeline)
My question is how to pass the user's claim to the upstream layer (our internal tools/dashboards) as http header? Is it possible?
Regards, Agung
UPDATED
I've tried with the suggestion here, here's the snippet of my /etc/apache2/sites-available/000-default.conf
<VirtualHost *:443>
ServerName my-host-name
UseCanonicalName on
ProxyPreserveHost on
DocumentRoot /var/www/html
# Pass the user's claim as http headers
OIDCPassClaimsAs "headers"
OIDCPassUserInfoAs "claims"
OIDCPassRefreshToken "On"
<Location />
AuthType openid-connect
<RequireAll>
Require claim email~^(.*)@domain.com$
Require claim email_verified:true
</RequireAll>
ProxyPass http://echo-server.default.svc.cluster.local:8080/
ProxyPassReverse http://echo-server.default.svc.cluster.local:8080/
LogLevel debug
</Location>
</VirtualHost>
I am using echoserver (gcr.io/google_containers/echoserver:1.0) as the backend of http://echo-server.default.svc.cluster.local:8080, and it doesn't print any user's claim as http headers. Is there any misconfiguration on my part? How to debug this problem?
That's what the module does by default: it will pass the user's claims in both environment variables and headers, which can be configured with
OIDCPassClaimsAs
as documented in: https://github.com/zmartzone/mod_auth_openidc/blob/v2.3.8/auth_openidc.conf#L668Note that those headers are added to the backend HTTP request that is propagated to the application so you won't see them in a browser.