Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(7)  |  Call(7)  |  Derive(0)  |  Import(0)
This method verifies that the response given from the client
is valid and if so returns a token used for authentication.

src/c/r/crtauth-HEAD/test/roundtrip_test.py   crtauth(Download)
        response = server.create_response(challenge, "server_name",
                                          ssh.SingleKeySigner(test_priv_key))
        token = auth_server.create_token(response)
        self.assertTrue(auth_server.validate_token(token))
 
                                          "another_server")
        try:
            auth_server_b.create_token(response)
            self.fail("should have thrown exception")
        except exceptions.InvalidInputException:
                                          now_func=lambda: time.time() - 1000)
        try:
            auth_server_b.create_token(response)
            self.fail("Should have issued InvalidInputException, "
                      "challenge too new")
                                          now_func=lambda: time.time() + 1000)
        try:
            auth_server_b.create_token(response)
            self.fail("Should have issued InvalidInputException, "
                      "challenge too old")
                  "Wl5n3U6qt6Fub2E", "random"):
            try:
                auth_server.create_token(t)
                self.fail("Input is invalid, should have thrown exception")
            except exceptions.ProtocolError: