예제 #1
0
        else:
            resp = BadRequest("Unknown request type: %s" % request.type)
            return resp(environ, start_response)

        # Add the key to the keystore
        if client_secret:
            _keystore.set_sign_key(client_secret, owner=client_id)
            _keystore.set_verify_key(client_secret, owner=client_id)

            _cinfo["registration_expires"] = time_util.time_sans_frac()+3600

            response["client_secret"] = client_secret
            response["expires_at"] = _cinfo["registration_expires"]

        if self.test_mode:
            logger.info("registration_response: %s" % response.to_dict())

        resp = Response(response.to_json(), content="application/json",
                        headers=[("Cache-Control", "no-store")])
        return resp(environ, start_response)

    #noinspection PyUnusedLocal
    def providerinfo_endpoint(self, environ, start_response, **kwargs):
        logger.info("@providerinfo_endpoint")
        try:
            _response = ProviderConfigurationResponse(
                            issuer=self.baseurl,
                            token_endpoint_auth_types_supported=[
                                                        "client_secret_post",
                                                        "client_secret_basic",
                                                        "client_secret_jwt"],