diff --git a/dev-env/add-keycloak-in-hosts.sh b/dev-env/add-keycloak-in-hosts.sh deleted file mode 100755 index ac9055662..000000000 --- a/dev-env/add-keycloak-in-hosts.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -echo '127.0.1.1 keycloak2.mydomain.com' >> /etc/hosts \ No newline at end of file diff --git a/dev-env/add-oidc.sh b/dev-env/add-oidc.sh deleted file mode 100755 index 51acba1a2..000000000 --- a/dev-env/add-oidc.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -curl -X POST -H 'Content-type: application/json' --upload-file oidc.json http://localhost:8080/api/admin/authenticationProviders \ No newline at end of file diff --git a/dev-env/docker-compose-dev.yml b/dev-env/docker-compose-dev.yml index 5b9c8fd1c..a068e7d60 100644 --- a/dev-env/docker-compose-dev.yml +++ b/dev-env/docker-compose-dev.yml @@ -32,9 +32,7 @@ services: ports: - 9080:9080 networks: - dataverse: - aliases: - - keycloak2.mydomain.com #create a DNS alias within the network (add the same alias to your /etc/hosts to get a working OIDC flow) + dataverse: {} dev_nginx: container_name: 'dev_nginx_proxy' @@ -86,7 +84,7 @@ services: DATAVERSE_AUTH_OIDC_ENABLED: "1" DATAVERSE_AUTH_OIDC_CLIENT_ID: oauth2-proxy DATAVERSE_AUTH_OIDC_CLIENT_SECRET: 72341b6d-7065-4518-a0e4-50ee15025608 - DATAVERSE_AUTH_OIDC_AUTH_SERVER_URL: http://keycloak2.mydomain.com:9080/realms/oauth2-proxy + DATAVERSE_AUTH_OIDC_AUTH_SERVER_URL: http://172.17.0.1:9080/realms/oauth2-proxy JVM_ARGS: -Ddataverse.pid.providers=fake -Ddataverse.pid.default-provider=fake -Ddataverse.pid.fake.type=FAKE diff --git a/dev-env/nginx.conf b/dev-env/nginx.conf index e74dfe423..e5c5628d9 100644 --- a/dev-env/nginx.conf +++ b/dev-env/nginx.conf @@ -6,6 +6,7 @@ http { location / { proxy_pass http://dataverse:8080; + proxy_set_header Authorization "Bearer ${http_x_forwarded_access_token}"; } location /spa { diff --git a/dev-env/oauth2-proxy-keycloak.cfg b/dev-env/oauth2-proxy-keycloak.cfg index d3a7dd5a0..039d3cb1f 100644 --- a/dev-env/oauth2-proxy-keycloak.cfg +++ b/dev-env/oauth2-proxy-keycloak.cfg @@ -7,8 +7,6 @@ cookie_domains=["localhost:4180", "localhost:8000", "localhost:9080"] # Required whitelist_domains=[".localhost"] # Required to allow redirection back to original requested target. skip_jwt_bearer_tokens="true" # will skip requests that have verified JWT bearer tokens (the token must have aud that matches this client id or one of the extras from extra-jwt-issuers) pass_access_token="true" -set_xauthrequest="true" -pass_authorization_header="true" # keycloak provider client_secret="72341b6d-7065-4518-a0e4-50ee15025608" @@ -17,6 +15,6 @@ redirect_url="http://localhost:4180/oauth2/callback" # in this case oauth2-proxy is going to visit # http://keycloak.localhost:9080/realms/oauth2-proxy/.well-known/openid-configuration for configuration -oidc_issuer_url="http://keycloak2.mydomain.com:9080/realms/oauth2-proxy" +oidc_issuer_url="http://172.17.0.1:9080/realms/oauth2-proxy" provider="oidc" provider_display_name="Keycloak" diff --git a/dev-env/oidc.json b/dev-env/oidc.json deleted file mode 100644 index 0777833a5..000000000 --- a/dev-env/oidc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": "oidc-keycloak", - "factoryAlias": "oidc", - "title": "OIDC-Keycloak", - "subtitle": "OIDC-Keycloak", - "factoryData": "type: oidc | issuer: http://keycloak2.mydomain.com:9080/realms/oauth2-proxy | clientId: oauth2-proxy | clientSecret: 72341b6d-7065-4518-a0e4-50ee15025608", - "enabled": true - } \ No newline at end of file