def registration(environ, start_response): _oas = environ["oic.oas"] if environ["REQUEST_METHOD"] == "POST": return wsgi_wrapper(environ, start_response, _oas.registration_endpoint) elif environ["REQUEST_METHOD"] == "GET": return wsgi_wrapper(environ, start_response, _oas.read_registration) else: resp = ServiceError("Method not supported") return resp(environ, start_response)
def authorization(environ, start_response, logger): _oas = environ["oic.oas"] return wsgi_wrapper(environ, start_response, _oas.authorization_endpoint, logger=logger)
def registration(environ, start_response, logger): _oas = environ["oic.oas"] if environ["REQUEST_METHOD"] == "POST": return wsgi_wrapper(environ, start_response, _oas.registration_endpoint, logger=logger) elif environ["REQUEST_METHOD"] == "GET": return wsgi_wrapper(environ, start_response, _oas.read_registration, logger=logger) else: resp = ServiceError("Method not supported") return resp(environ, start_response)
def token(environ, start_response, logger): _oas = environ["oic.oas"] return wsgi_wrapper(environ, start_response, _oas.token_endpoint, logger=logger)
def userinfo(environ, start_response, logger): _oas = environ["oic.oas"] return wsgi_wrapper(environ, start_response, _oas.userinfo_endpoint, logger=logger)
# Static file handling static_config = { "/static": { "tools.staticdir.on": True, "tools.staticdir.dir": config.STATIC_DIR } } static_handler = cherrypy.tree.mount(None, "/", config=static_config) # Setup endpoints all_endpoints = [ ("/.well-known/openid-configuration", OICProviderMiddleware(OAS, op_info)), ("/.well-known/webfinger", OICProviderMiddleware(OAS, webfinger)), ("/verify", lambda environ, start_response: wsgi_wrapper(environ, start_response, authn.verify)), ("/my_tokens", OICProviderMiddleware(OAS, list_access_tokens)), ("/consent_ok", OICProviderMiddleware(OAS, consent)), ("/revoke_token", OICProviderMiddleware(OAS, revoke_access_token)), ("/static", static_handler) ] for ep in ENDPOINTS: all_endpoints.append(("/%s" % ep.etype, OICProviderMiddleware(OAS, ep))) d = wsgiserver.WSGIPathInfoDispatcher(all_endpoints) SRV = wsgiserver.CherryPyWSGIServer(('0.0.0.0', args.port), d) https = "" if baseurl.startswith("https"): https = "using HTTPS"
def introspection(environ, start_response): _oas = environ["oic.oas"] return wsgi_wrapper(environ, start_response, _oas.introspection_endpoint)
def token(self, environ, start_response): return wsgi_wrapper(environ, start_response, self.oas.token_endpoint)
def verify(environ, start_response): _oas = environ["oic.oas"] return wsgi_wrapper(environ, start_response, _oas.verify_endpoint)
def endsession(environ, start_response): _oas = environ["oic.oas"] return wsgi_wrapper(environ, start_response, _oas.endsession_endpoint)
def trace_log(environ, start_response, logger): _oas = environ["oic.oas"] return wsgi_wrapper(environ, start_response, _oas.tracelog_endpoint, logger=logger)
def swd_info(environ, start_response, logger): _oas = environ["oic.oas"] return wsgi_wrapper(environ, start_response, _oas.discovery_endpoint, logger=logger)
def check_id(environ, start_response, logger): _oas = environ["oic.oas"] return wsgi_wrapper(environ, start_response, _oas.check_id_endpoint, logger=logger)
def revocation(self, environ, start_response): return wsgi_wrapper(environ, start_response, self.oas.revocation_endpoint)
def introspection(self, environ, start_response): return wsgi_wrapper(environ, start_response, self.oas.introspection_endpoint)
def config(self, environ, start_response): return wsgi_wrapper(environ, start_response, self.oas.providerinfo_endpoint)
def authorization(self, environ, start_response): return wsgi_wrapper(environ, start_response, self.oas.authorization_endpoint)
def userinfo(environ, start_response): _oas = environ["oic.oas"] return wsgi_wrapper(environ, start_response, _oas.userinfo_endpoint)
def revocation(environ, start_response): _oas = environ["oic.oas"] return wsgi_wrapper(environ, start_response, _oas.revocation_endpoint)
def verify(self, environ, start_response): return wsgi_wrapper(environ, start_response, self.oas.verify_endpoint)
def list_access_tokens(environ, start_response): _oas = environ["oic.oas"] return wsgi_wrapper(environ, start_response, _oas.list_access_tokens_endpoint)
def op_info(environ, start_response, logger): _oas = environ["oic.oas"] return wsgi_wrapper(environ, start_response, _oas.providerinfo_endpoint, logger=logger)
def authorization(environ, start_response): _oas = environ["oic.oas"] return wsgi_wrapper(environ, start_response, _oas.authorization_endpoint)
def token(environ, start_response): _oas = environ["oic.oas"] return wsgi_wrapper(environ, start_response, _oas.token_endpoint)
def config(environ, start_response): _oas = environ["oic.oas"] return wsgi_wrapper(environ, start_response, _oas.providerinfo_endpoint)