예제 #1
0
    def verify(self, **kwargs):
        if "scopes_supported" in self:
            assert "openid" in self["scopes_supported"]
            for scope in self["scopes_supported"]:
                check_char_set(scope, SCOPE_CHARSET)

        parts = urlparse(self["issuer"])
        try:
            assert parts.scheme == "https"
        except AssertionError:
            raise SchemeError("Not HTTPS")

        assert not parts.query and not parts.fragment

        return super(ProviderConfigurationResponse, self).verify(**kwargs)
예제 #2
0
파일: message.py 프로젝트: zckb/pyoidc
    def verify(self, **kwargs):
        super(ProviderConfigurationResponse, self).verify(**kwargs)

        if "scopes_supported" in self:
            assert "openid" in self["scopes_supported"]
            for scope in self["scopes_supported"]:
                check_char_set(scope, SCOPE_CHARSET)

        parts = urlparse(self["issuer"])
        if parts.scheme != "https":
            raise SchemeError("Not HTTPS")

        assert not parts.query and not parts.fragment

        if any("code" in rt for rt in self["response_types_supported"]
               ) and "token_endpoint" not in self:
            raise MissingRequiredAttribute("token_endpoint")

        return True
예제 #3
0
    def verify(self, **kwargs):
        super().verify(**kwargs)

        if "scopes_supported" in self:
            if "openid" not in self["scopes_supported"]:
                raise AssertionError()
            for scope in self["scopes_supported"]:
                check_char_set(scope, SCOPE_CHARSET)

        parts = urlparse(self["issuer"])
        if parts.scheme != "https":
            raise SchemeError("Not HTTPS")

        if parts.query or parts.fragment:
            raise AssertionError()

        if (any("code" in rt for rt in self["response_types_supported"])
                and "token_endpoint" not in self):
            raise MissingRequiredAttribute("token_endpoint")

        return True