Exemplo n.º 1
0
 def test_supports_dynamic_discovery(self, provider_metadata,
                                     client_metadata):
     responses.add(responses.GET,
                   ISSUER + "/.well-known/openid-configuration",
                   body=json.dumps(provider_metadata),
                   status=200,
                   content_type='application/json')
     client = _create_client(dict(issuer=ISSUER), client_metadata)
     self.assert_provider_metadata(provider_metadata, client)
Exemplo n.º 2
0
 def test_supports_dynamic_discovery(self, provider_metadata, client_metadata):
     responses.add(
         responses.GET,
         ISSUER + "/.well-known/openid-configuration",
         body=json.dumps(provider_metadata),
         status=200,
         content_type='application/json'
     )
     client = _create_client(dict(issuer=ISSUER), client_metadata)
     self.assert_provider_metadata(provider_metadata, client)
Exemplo n.º 3
0
    def test_supports_dynamic_client_registration(self, provider_metadata, client_metadata):
        with responses.RequestsMock(assert_all_requests_are_fired=True) as rsps:
            rsps.add(
                responses.POST,
                provider_metadata["registration_endpoint"],
                body=json.dumps(client_metadata),
                status=200,
                content_type='application/json'
            )
            client = _create_client(provider_metadata, dict(redirect_uris=client_metadata["redirect_uris"]))

        self.assert_client_metadata(client_metadata, client)
Exemplo n.º 4
0
    def test_supports_dynamic_client_registration(self, provider_metadata,
                                                  client_metadata):
        with responses.RequestsMock(
                assert_all_requests_are_fired=True) as rsps:
            rsps.add(responses.POST,
                     provider_metadata["registration_endpoint"],
                     body=json.dumps(client_metadata),
                     status=200,
                     content_type='application/json')
            client = _create_client(
                provider_metadata,
                dict(redirect_uris=client_metadata["redirect_uris"]))

        self.assert_client_metadata(client_metadata, client)
Exemplo n.º 5
0
 def test_supports_static_client_registration(self, provider_metadata,
                                              client_metadata):
     client = _create_client(provider_metadata, client_metadata)
     self.assert_client_metadata(client_metadata, client)
Exemplo n.º 6
0
 def test_supports_static_provider_discovery(self, provider_metadata,
                                             client_metadata):
     client = _create_client(provider_metadata, client_metadata)
     self.assert_provider_metadata(provider_metadata, client)
Exemplo n.º 7
0
 def test_init(self, provider_metadata, client_metadata):
     client = _create_client(provider_metadata, client_metadata)
     assert isinstance(client, oic.oic.Client)
     assert client.client_authn_method == CLIENT_AUTHN_METHOD
Exemplo n.º 8
0
 def test_supports_static_client_registration(self, provider_metadata, client_metadata):
     client = _create_client(provider_metadata, client_metadata)
     self.assert_client_metadata(client_metadata, client)
Exemplo n.º 9
0
 def test_supports_static_provider_discovery(self, provider_metadata, client_metadata):
     client = _create_client(provider_metadata, client_metadata)
     self.assert_provider_metadata(provider_metadata, client)
Exemplo n.º 10
0
 def test_init(self, provider_metadata, client_metadata):
     client = _create_client(provider_metadata, client_metadata)
     assert isinstance(client, oic.oic.Client)
     assert client.client_authn_method == CLIENT_AUTHN_METHOD