cp_mgmt_api_python_sdk icon indicating copy to clipboard operation
cp_mgmt_api_python_sdk copied to clipboard

API_key request login failed

Open Sarta92 opened this issue 4 years ago • 4 comments

Hi,

I testing your sdk and there is a problem with API_key request.

def main():
    api_server = "10.0.20.254"
    server_port = 8443
    client_args = APIClientArgs(server=api_server, port=server_port)
    api_key="xxxxxxxxxxxxxxxxxx=="
    with APIClient(client_args) as client:   
        # login to server:
        login_res = client.login_with_api_key(api_key)
        if login_res.success is False:
            print("Login failed: {}".format(login_res.error_message))
            exit(1)

I have this error : Login failed: APIResponse received a response which is not a valid JSON.

I tested with the original port (443) it's the same. I tested the API_key on the MGMT locally and it's works.

With client.login(username,password) work fine.

Can you help me please ?

Sarta92 avatar Mar 09 '21 11:03 Sarta92

Can you please share the error and the api.elg (please send to [email protected])?

chkp-orso avatar Mar 10 '21 10:03 chkp-orso

Getting a similar issue on a Red Hat 8 server using the python36 included with the OS. The same script works fine on a older Red Hat 6 server.

razron avatar May 19 '21 05:05 razron