From d182d37d555557059915d81fef646cbbc9fd3779 Mon Sep 17 00:00:00 2001 From: Scott Koranda Date: Sat, 24 Mar 2018 17:49:32 -0500 Subject: [PATCH] Added .htaccess for mod_auth_openidc for name environment Added a modified .htaccess file that is COPY'd into the image from the Dockerfile. The modified .htaccess file adds three RewriteRule lines to add environment variables OIDC_CLAIM_NAME_GIVEN, OIDC_CLAIM_NAME_FAMILY, and OIDC_CLAIM_NAME_MIDDLE if the standard OIDC claims are asserted so that they can then be consumed during an enrollment flow as the default value for a name entry such as Name (Official, CO Person). --- .../Dockerfile.template | 2 ++ comanage-registry-mod-auth-openidc/htaccess | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 comanage-registry-mod-auth-openidc/htaccess diff --git a/comanage-registry-mod-auth-openidc/Dockerfile.template b/comanage-registry-mod-auth-openidc/Dockerfile.template index 86b678a..2c753b9 100644 --- a/comanage-registry-mod-auth-openidc/Dockerfile.template +++ b/comanage-registry-mod-auth-openidc/Dockerfile.template @@ -117,6 +117,8 @@ RUN mkdir -p "$COMANAGE_REGISTRY_DIR" \ COPY docker-comanage-entrypoint /usr/local/bin/ +COPY htaccess /srv/comanage-registry/app/webroot/.htaccess + # expose COmanage Registry local directory VOLUME ["/local"] diff --git a/comanage-registry-mod-auth-openidc/htaccess b/comanage-registry-mod-auth-openidc/htaccess new file mode 100644 index 0000000..abc475b --- /dev/null +++ b/comanage-registry-mod-auth-openidc/htaccess @@ -0,0 +1,11 @@ + + RewriteEngine On + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^(.*)$ index.php?/$1 [QSA,L] + + RewriteRule .* - [E=OIDC_CLAIM_NAME_GIVEN:%{HTTP:OIDC_CLAIM_given_name}] + RewriteRule .* - [E=OIDC_CLAIM_NAME_FAMILY:%{HTTP:OIDC_CLAIM_family_name}] + RewriteRule .* - [E=OIDC_CLAIM_NAME_MIDDLE:%{HTTP:OIDC_CLAIM_middle_name}] + +