<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: RestAPI login issue via python in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/RestAPI-login-issue-via-python/m-p/61628#M3845</link>
    <description>Is NPE-DATACENTRE the name of the Domain or of the Domain Management Server?&lt;BR /&gt;It needs to be of the Domain itself, the name you see in the left column in the Domains list.</description>
    <pubDate>Mon, 02 Sep 2019 08:08:28 GMT</pubDate>
    <dc:creator>Maarten_Sjouw</dc:creator>
    <dc:date>2019-09-02T08:08:28Z</dc:date>
    <item>
      <title>RestAPI login issue via python</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/RestAPI-login-issue-via-python/m-p/61622#M3844</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to access to login into a specific domain using python import library and getting below errors. I am not sure why i am getting syntax error&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-sh-4.1$ python3.6 login.py&lt;BR /&gt;{&lt;BR /&gt;"code" : "generic_err_invalid_syntax",&lt;BR /&gt;"message" : "Login request message processing failed"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Code details&amp;nbsp;&lt;/P&gt;&lt;P&gt;import requests&lt;BR /&gt;from pprint import pprint&lt;BR /&gt;import json&lt;BR /&gt;import urllib3&lt;BR /&gt;urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)&lt;BR /&gt;URL ="https://*.*.*.*/web_api/login"&lt;BR /&gt;headers = {"Content-Type":"application/json"}&lt;BR /&gt;page=requests.post(URL,headers=headers,verify=False,data={"user":"username","password":"password","domain":"NPE-DATACENTRE"})&lt;BR /&gt;print(page.text)&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2019 05:35:29 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/RestAPI-login-issue-via-python/m-p/61622#M3844</guid>
      <dc:creator>Deepak_Chauhan1</dc:creator>
      <dc:date>2019-09-02T05:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: RestAPI login issue via python</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/RestAPI-login-issue-via-python/m-p/61628#M3845</link>
      <description>Is NPE-DATACENTRE the name of the Domain or of the Domain Management Server?&lt;BR /&gt;It needs to be of the Domain itself, the name you see in the left column in the Domains list.</description>
      <pubDate>Mon, 02 Sep 2019 08:08:28 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/RestAPI-login-issue-via-python/m-p/61628#M3845</guid>
      <dc:creator>Maarten_Sjouw</dc:creator>
      <dc:date>2019-09-02T08:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: RestAPI login issue via python</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/RestAPI-login-issue-via-python/m-p/61634#M3848</link>
      <description>&lt;P&gt;Yes, NPE datacenter is the name of the domain. I have tried everything and it didn't work.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2019 11:04:54 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/RestAPI-login-issue-via-python/m-p/61634#M3848</guid>
      <dc:creator>Deepak_Chauhan1</dc:creator>
      <dc:date>2019-09-02T11:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: RestAPI login issue via python</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/RestAPI-login-issue-via-python/m-p/61639#M3849</link>
      <description>NPE-DATACENTRE or NPE-DATACENTER? And it is case sensitive!</description>
      <pubDate>Mon, 02 Sep 2019 12:19:58 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/RestAPI-login-issue-via-python/m-p/61639#M3849</guid>
      <dc:creator>Maarten_Sjouw</dc:creator>
      <dc:date>2019-09-02T12:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: RestAPI login issue via python</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/RestAPI-login-issue-via-python/m-p/61641#M3850</link>
      <description>Hi Maarten,&lt;BR /&gt;[Expert@mdmnnp420:0]# $MDSVERUTIL AllCMAs | grep NPE&lt;BR /&gt;NPE_DATACENTRE_Management_Server-NN&lt;BR /&gt;I have tried this and IP address as well.&lt;BR /&gt;Interestingly, I am seeing SSL alert messages on Wireshark. Is it mandatory to have valid certs for restapi?&lt;BR /&gt;mgmt_cli commands are working fine locally on mgmt server</description>
      <pubDate>Mon, 02 Sep 2019 12:27:57 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/RestAPI-login-issue-via-python/m-p/61641#M3850</guid>
      <dc:creator>Deepak_Chauhan1</dc:creator>
      <dc:date>2019-09-02T12:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: RestAPI login issue via python</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/RestAPI-login-issue-via-python/m-p/61657#M3852</link>
      <description>Try it with curl first just to make sure everything's working.&lt;BR /&gt;curl_cli -vvvv -H "Content-Type: application/json" -X POST -d '{"user":"XXXXXX","password":"YYYYYYYYY","domain":"ZZZ"}' &lt;A href="https://a.b.c.d/web_api/login" target="_blank"&gt;https://a.b.c.d/web_api/login&lt;/A&gt; --insecure</description>
      <pubDate>Mon, 02 Sep 2019 15:31:54 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/RestAPI-login-issue-via-python/m-p/61657#M3852</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2019-09-02T15:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: RestAPI login issue via python</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/RestAPI-login-issue-via-python/m-p/61684#M3855</link>
      <description>I have got the same error. Common name and hostname/ip doesn't match&lt;BR /&gt;&lt;BR /&gt;---&lt;BR /&gt;sh-4.1$ curl -vvvv -H "Content-Type: application/json" -X POST -d '{"user":"username","password":"password","domain":"NPE_DATACENTRE_Management_Server-NN"}' &lt;A href="https://a.b.c.d/web_api/login" target="_blank"&gt;https://a.b.c.d/web_api/login&lt;/A&gt; --insecure&lt;BR /&gt;* About to connect() to ****** port 443 (#0)&lt;BR /&gt;* Trying *.*.*.*... connected&lt;BR /&gt;* Connected to ****** (*.*.*.*) port 443 (#0)&lt;BR /&gt;* Initializing NSS with certpath: sql:/etc/pki/nssdb&lt;BR /&gt;* warning: ignoring value of ssl.verifyhost&lt;BR /&gt;* skipping SSL peer certificate verification&lt;BR /&gt;* SSL connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256&lt;BR /&gt;* Server certificate:&lt;BR /&gt;* subject: OID.1.2.840.113549.1.9.2=An optional company name,E=Email Address,CN=192.168.1.1,L="Locality Name (eg, city)"&lt;BR /&gt;* start date: Jun 23 03:48:00 2018 GMT&lt;BR /&gt;* expire date: Jun 22 03:48:00 2028 GMT&lt;BR /&gt;* common name: 192.168.1.1&lt;BR /&gt;* issuer: OID.1.2.840.113549.1.9.2=An optional company name,E=Email Address,CN=192.168.1.1,L="Locality Name (eg, city)"&lt;BR /&gt;&amp;gt; POST /web_api/login HTTP/1.1&lt;BR /&gt;&amp;gt; User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2&lt;BR /&gt;&amp;gt; Host: ******&lt;BR /&gt;&amp;gt; Accept: */*&lt;BR /&gt;&amp;gt; Content-Type: application/json&lt;BR /&gt;&amp;gt; Content-Length: 90&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;lt; HTTP/1.1 400 Bad Request&lt;BR /&gt;&amp;lt; Date: Mon, 02 Sep 2019 22:38:04 GMT&lt;BR /&gt;&amp;lt; Server: CPWS&lt;BR /&gt;&amp;lt; X-Frame-Options: SAMEORIGIN&lt;BR /&gt;&amp;lt; Content-Type: application/json&lt;BR /&gt;&amp;lt; X-UA-Compatible: IE=EmulateIE8&lt;BR /&gt;&amp;lt; X-Forwarded-Host-Port: 443&lt;BR /&gt;&amp;lt; Connection: close&lt;BR /&gt;&amp;lt; Transfer-Encoding: chunked&lt;BR /&gt;&amp;lt;&lt;BR /&gt;{&lt;BR /&gt;"code" : "generic_err_invalid_syntax",&lt;BR /&gt;"message" : "Login request message processing failed"&lt;BR /&gt;* Closing connection #0&lt;BR /&gt;}-sh-4.1$</description>
      <pubDate>Mon, 02 Sep 2019 22:42:03 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/RestAPI-login-issue-via-python/m-p/61684#M3855</guid>
      <dc:creator>Deepak_Chauhan1</dc:creator>
      <dc:date>2019-09-02T22:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: RestAPI login issue via python</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/RestAPI-login-issue-via-python/m-p/61771#M3856</link>
      <description>The API server may not be enabled.&lt;BR /&gt;See: &lt;A href="https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/Enabling-web-api/m-p/32641#M2011" target="_blank"&gt;https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/Enabling-web-api/m-p/32641#M2011&lt;/A&gt;</description>
      <pubDate>Tue, 03 Sep 2019 15:21:15 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/RestAPI-login-issue-via-python/m-p/61771#M3856</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2019-09-03T15:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: RestAPI login issue via python</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/RestAPI-login-issue-via-python/m-p/61915#M3900</link>
      <description>Same issue&lt;BR /&gt;[Expert@abcd:0]# mgmt_cli -r true --domain MDS set api-settings accepted-api-calls-from "All IP addresses"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;---------------------------------------------&lt;BR /&gt;Time: [10:36:56] 5/9/2019&lt;BR /&gt;---------------------------------------------&lt;BR /&gt;"Publish operation" in progress (10%)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;---------------------------------------------&lt;BR /&gt;Time: [10:37:06] 5/9/2019&lt;BR /&gt;---------------------------------------------&lt;BR /&gt;"Publish operation" succeeded (100%)&lt;BR /&gt;[Expert@mdmnnp420:0]# api restart&lt;BR /&gt;2019-Sep-05 10:37:51 - Stopping API...&lt;BR /&gt;2019-Sep-05 10:37:53 - API stopped successfully.&lt;BR /&gt;2019-Sep-05 10:37:53 - Starting API...&lt;BR /&gt;. . . . . . . . .&lt;BR /&gt;2019-Sep-05 10:38:47 - API started successfully.&lt;BR /&gt;&lt;BR /&gt;===========&lt;BR /&gt;&amp;gt; POST /web_api/login HTTP/1.1&lt;BR /&gt;&amp;gt; User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2&lt;BR /&gt;&amp;gt; Host: mdmnnp420&lt;BR /&gt;&amp;gt; Accept: */*&lt;BR /&gt;&amp;gt; Content-Type: application/json&lt;BR /&gt;&amp;gt; Content-Length: 90&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;lt; HTTP/1.1 400 Bad Request&lt;BR /&gt;&amp;lt; Date: Thu, 05 Sep 2019 00:40:47 GMT&lt;BR /&gt;&amp;lt; Server: CPWS&lt;BR /&gt;&amp;lt; X-Frame-Options: SAMEORIGIN&lt;BR /&gt;&amp;lt; Content-Type: application/json&lt;BR /&gt;&amp;lt; X-UA-Compatible: IE=EmulateIE8&lt;BR /&gt;&amp;lt; X-Forwarded-Host-Port: 443&lt;BR /&gt;&amp;lt; Connection: close&lt;BR /&gt;&amp;lt; Transfer-Encoding: chunked&lt;BR /&gt;&amp;lt;&lt;BR /&gt;{&lt;BR /&gt;"code" : "generic_err_invalid_syntax",&lt;BR /&gt;"message" : "Login request message processing failed"&lt;BR /&gt;* Closing connection #0&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Sep 2019 00:43:13 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/RestAPI-login-issue-via-python/m-p/61915#M3900</guid>
      <dc:creator>Deepak_Chauhan1</dc:creator>
      <dc:date>2019-09-05T00:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: RestAPI login issue via python</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/RestAPI-login-issue-via-python/m-p/61957#M3907</link>
      <description>Just to make absolute certain you're passing the correct domain as part of the call, run this script to get the actual name: &lt;A href="https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/List-all-domain-names-bash-script/m-p/38906#M2372" target="_blank"&gt;https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/List-all-domain-names-bash-script/m-p/38906#M2372&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Otherwise, I suggest getting the TAC involved.</description>
      <pubDate>Thu, 05 Sep 2019 14:51:24 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/RestAPI-login-issue-via-python/m-p/61957#M3907</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2019-09-05T14:51:24Z</dc:date>
    </item>
  </channel>
</rss>

