CLIENT_FUNCTION = { "openid_request": construct_openid_request, } # Start with dynamic discovery client_config = {} c = Consumer(None, client_config) # emulating this #res = c.discover(principal) principal = "*****@*****.**" domain = c.get_domain(principal) uri = c.issuer_query(SWD_PATTERN % domain, principal) # ----- On the server side ----- app = TestApp(application) result = app.get(uri, extra_environ={"oic.server":SERVER, "mako.lookup":LOOKUP}) # ++++ client side, parse the result ++++ assert result.status == "200 OK" res = json.loads(result.body) # location of the authorization server as_loc = OIDCONF_PATTERN % res["locations"][0] app = TestApp(application)