Пример #1
0
    def __init__(self, oas, urls):
        self.oas = oas

        self.endpoints = [
            AuthorizationEndpoint(self.authorization),
            TokenEndpoint(self.token),
            UserinfoEndpoint(self.userinfo),
            RegistrationEndpoint(self.registration),
            EndSessionEndpoint(self.endsession),
        ]

        self.oas.endpoints = self.endpoints
        self.urls = urls
        self.urls.extend([
            (r'^.well-known/openid-configuration', self.op_info),
            (r'^.well-known/simple-web-discovery', self.swd_info),
            (r'^.well-known/host-meta.json', self.meta_info),
            (r'^.well-known/webfinger', self.webfinger),
            #    (r'^.well-known/webfinger', webfinger),
            (r'.+\.css$', self.css),
            (r'safe', self.safe),
            (r'^keyrollover', key_rollover),
            (r'^clearkeys', clear_keys),
            (r'^check_session', check_session_iframe)
            #    (r'tracelog', trace_log),
        ])

        self.add_endpoints(self.endpoints)
Пример #2
0
    def __init__(self, provider, urls):
        self.provider = provider

        self.endpoints = [
            AuthorizationEndpoint(self.authorization),
            TokenEndpoint(self.token),
            UserinfoEndpoint(self.userinfo),
            RegistrationEndpoint(self.registration),
            EndSessionEndpoint(self.endsession),
        ]

        self.provider.endp = self.endpoints
        self.urls = urls
        self.urls.extend([(r'^.well-known/openid-configuration', self.op_info),
                          (r'^.well-known/simple-web-discovery',
                           self.swd_info),
                          (r'^.well-known/host-meta.json', self.meta_info),
                          (r'^.well-known/webfinger', self.webfinger),
                          (r'.+\.css$', self.css), (r'safe', self.safe),
                          (r'^keyrollover', key_rollover),
                          (r'^clearkeys', clear_keys),
                          (r'^check_session', check_session_iframe)])

        for endp in self.endpoints:
            self.urls.append(("^%s" % endp.etype, endp.func))
Пример #3
0
def setup_endpoints(provider):
    """Setup the OpenID Connect Provider endpoints."""
    app_routing = {}
    endpoints = [
        AuthorizationEndpoint(pyoidcMiddleware(
            provider.authorization_endpoint)),
        TokenEndpoint(pyoidcMiddleware(provider.token_endpoint)),
        UserinfoEndpoint(pyoidcMiddleware(provider.userinfo_endpoint)),
        RegistrationEndpoint(pyoidcMiddleware(provider.registration_endpoint)),
        EndSessionEndpoint(pyoidcMiddleware(provider.endsession_endpoint))
    ]

    for ep in endpoints:
        app_routing["/{}".format(ep.etype)] = ep

    return app_routing
Пример #4
0
        return [text]
    except IOError:
        resp = NotFound()
        return resp(environ, start_response)


# ----------------------------------------------------------------------------
from oic.oic.provider import AuthorizationEndpoint
from oic.oic.provider import TokenEndpoint
from oic.oic.provider import UserinfoEndpoint
from oic.oic.provider import RegistrationEndpoint

ENDPOINTS = [
    AuthorizationEndpoint(authorization),
    TokenEndpoint(token),
    UserinfoEndpoint(userinfo),
    RegistrationEndpoint(registration),
    EndSessionEndpoint(endsession),
]

URLS = [
    (r'^verify', verify),
    (r'^.well-known/openid-configuration', op_info),
    (r'^.well-known/simple-web-discovery', swd_info),
    (r'^.well-known/host-meta.json', meta_info),
    (r'^.well-known/webfinger', webfinger),
    #    (r'^.well-known/webfinger', webfinger),
    (r'.+\.css$', css),
    (r'safe', safe),
    #    (r'tracelog', trace_log),
]
from oic.oic.provider import TokenEndpoint
from oic.oic.provider import UserinfoEndpoint
from oic.oic.provider import RegistrationEndpoint
from course_provider import CourseProvider

LOGGER = logging.getLogger("oic")
hdlr = logging.StreamHandler(sys.stdout)
LOGGER.addHandler(hdlr)
LOGGER.setLevel(logging.DEBUG)

PASSWD = {"diana": "krall", "babs": "howes", "upper": "crust"}

ENDPOINTS = [
    AuthorizationEndpoint(),
    TokenEndpoint(),
    UserinfoEndpoint(),
    RegistrationEndpoint(),
]


def add_endpoints(endpoints, endpoint_functions):
    global URLS

    for endp, func in zip(endpoints, endpoint_functions):
        URLS.append(("^%s" % endp.etype, func))


ROOT = './'

LOOKUP = TemplateLookup(directories=['templates'],
                        input_encoding='utf-8',