Commit 4acf4b7d authored by Auke Klazema's avatar Auke Klazema

TMSS-143: Set OIDC urls correctly based on Environment or defaults

parent 1f34ea57
......@@ -207,10 +207,9 @@ if "OIDC_RP_CLIENT_ID" in os.environ.keys():
OIDC_RP_CLIENT_ID = os.environ.get('OIDC_RP_CLIENT_ID', '2') # Secret, do not put real credentials on Git
'secret') # Secret, do not put real credentials on Git
OIDC_ENDPOINT_HOST = os.environ.get('OIDC_ENDPOINT_HOST', 'tmss_test_oidc')
OIDC_OP_AUTHORIZATION_ENDPOINT = "http://%s:8088/openid/authorize" % OIDC_ENDPOINT_HOST
OIDC_OP_TOKEN_ENDPOINT = "http://%s:8088/openid/token" % OIDC_ENDPOINT_HOST
OIDC_OP_USER_ENDPOINT = "http://%s:8088/openid/userinfo" % OIDC_ENDPOINT_HOST
OIDC_OP_AUTHORIZATION_ENDPOINT = os.environ.get('OIDC_OP_AUTHORIZATION_ENDPOINT', "http://localhost:8088/openid/authorize")
OIDC_OP_TOKEN_ENDPOINT = os.environ.get('OIDC_OP_TOKEN_ENDPOINT', "http://localhost:8088/openid/token")
OIDC_OP_USER_ENDPOINT = os.environ.get('OIDC_OP_USER_ENDPOINT', "http:/localhost:8088/openid/userinfo")
AUTHENTICATION_BACKENDS = ('mozilla_django_oidc.auth.OIDCAuthenticationBackend',)
elif "TMSS_LDAPCREDENTIALS" in os.environ.keys():
FROM python:3.6
COPY testprovider /code/
COPY testprovider/requirements.txt /code/
RUN pip install -r requirements.txt
COPY testprovider /code/
CMD ./bin/
RUN if [ -n "$OIDC_OP_CALLBACK_ENDPOINT" ]; then sed -i "s|http://localhost:8008/oidc/callback/|$OIDC_OP_CALLBACK_ENDPOINT|" fixtures.json; fi
python migrate --noinput
python loaddata fixtures.json
python ./ createuser paulus pauluspass paulus@localhost
python runserver
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment