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
OIDC_RP_CLIENT_SECRET = os.environ.get('OIDC_RP_CLIENT_SECRET',
'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
EXPOSE 8088
COPY testprovider /code/
WORKDIR /code
COPY testprovider/requirements.txt /code/
RUN pip install -r requirements.txt
COPY testprovider /code/
CMD ./bin/run.sh
#!/bin/sh
RUN if [ -n "$OIDC_OP_CALLBACK_ENDPOINT" ]; then sed -i "s|http://localhost:8008/oidc/callback/|$OIDC_OP_CALLBACK_ENDPOINT|" fixtures.json; fi
python manage.py migrate --noinput
python manage.py loaddata fixtures.json
python ./manage.py createuser paulus pauluspass paulus@localhost
python manage.py runserver 0.0.0.0:8088
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