Skip to content

API_key request login failed #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Sarta92 opened this issue Mar 9, 2021 · 4 comments
Open

API_key request login failed #30

Sarta92 opened this issue Mar 9, 2021 · 4 comments

Comments

@Sarta92
Copy link

Sarta92 commented Mar 9, 2021

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 ?

@chkp-orso
Copy link
Contributor

chkp-orso commented Mar 10, 2021

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

@razron
Copy link

razron commented May 19, 2021

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.

@PickleG
Copy link

PickleG commented May 21, 2025

Four years later, and api_key support appears to still be broken. Any chance of getting the tool updated? And the example scripts ?

@chkp-edenbr
Copy link
Contributor

Hi @PickleG ,
Our SDK has a simple example script creating a group using api-key on login https://github.com/CheckPointSW/cp_mgmt_api_python_sdk/blob/master/examples_python3/add_group_with_api_key.py
Does this fail for you? If so please share what the failure error is and the api.elg that can be found in $MDS_FWDIR/log/ (send to [email protected])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants