Commit 77551064 authored by Michael Völske's avatar Michael Völske

Update openid_app.py

parent 294a65c0
......@@ -13,6 +13,16 @@ ENV = ['OPENID_APP_ID',
'OPENID_CALLBACK_URL']
CB_ROUTE = ""
if not (all(x in os.environ for x in ENV)):
logger.error("Make sure all evironment variables in %s are set", ENV)
sys.exit(1)
ENV = dict((k, os.environ[k]) for k in ENV)
CB_ROUTE = "/".join(ENV['OPENID_CALLBACK_URL'].split('//')[1].split(':')[-1].split('/')[1:])
logger.info("Will send callbacks to /%s", CB_ROUTE)
from oic import rndstr
from oic.oic import Client
from oic.oic.message import RegistrationResponse, AuthorizationResponse
......@@ -188,14 +198,6 @@ def openid_app():
python:3 image)
"""
global ENV, CB_ROUTE
if not (all(x in os.environ for x in ENV)):
logger.error("Make sure all evironment variables in %s are set", ENV)
sys.exit(1)
ENV = dict((k, os.environ[k]) for k in ENV)
CB_ROUTE = "/".join(ENV['OPENID_CALLBACK_URL'].split('//')[1].split(':')[-1].split('/')[1:])
logger.info("Will send callbacks to /%s", CB_ROUTE)
logger.info("Setting up...")
retval = os.system('pip install bottle==0.12.* oic==0.15.*')
......
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