cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
983
Views
0
Helpful
0
Replies

Nexus Data Broker Version 3.5.0 - API Authorization Issue

nvizel
Level 1
Level 1

Hi, 

I am new with Nexus Data Broker. 

 

I am using python to set new filters and connections rules on demand for our monitoring devices. 

 

The issue is that any creation or modification actions that I am trying to do ends with 401 Authorization Required message while the cookies are valid. 

 

I build my on API over yours Swagger UI with python request module. 

 

Do I need to add some system configurations to allow this operation via REST calls? 

When I perform this operation via the Swagger UI, the operation pass 

  


>>> ndb.add_or_modify_a_filter(filterName='test_me_2',data = f) 2018-02-27_18:56:34 | INFO | perform Nexus API call: add_or_modify_a_filter preforming login authentication * Trying 10.10.10.73... * TCP_NODELAY set % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 10.10.10.73 (10.10.10.73) port 8443 (#0) * ALPN, offering h2 * ALPN, offering http/1.1 * Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH * successfully set certificate verify locations: * CAfile: /etc/ssl/certs/ca-certificates.crt CApath: /etc/ssl/certs * TLSv1.2 (OUT), TLS header, Certificate Status (22): } [5 bytes data] * TLSv1.2 (OUT), TLS handshake, Client hello (1): } [512 bytes data] * TLSv1.2 (IN), TLS handshake, Server hello (2): { [81 bytes data] * TLSv1.2 (IN), TLS handshake, Certificate (11): { [919 bytes data] * TLSv1.2 (IN), TLS handshake, Server key exchange (12): { [333 bytes data] * TLSv1.2 (IN), TLS handshake, Server finished (14): { [4 bytes data] * TLSv1.2 (OUT), TLS handshake, Client key exchange (16): } [70 bytes data] * TLSv1.2 (OUT), TLS change cipher, Client hello (1): } [1 bytes data] * TLSv1.2 (OUT), TLS handshake, Finished (20): } [16 bytes data] * TLSv1.2 (IN), TLS change cipher, Client hello (1): { [1 bytes data] * TLSv1.2 (IN), TLS handshake, Finished (20): { [16 bytes data] * SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256 * ALPN, server did not agree to a protocol * Server certificate: * subject: C=US; ST=California; L=San Jose; O=Cisco Systems; OU=Cisco XNC; CN=Cisco XNC * start date: Feb 3 17:42:13 2014 GMT * expire date: Feb 2 17:42:13 2019 GMT * issuer: C=US; ST=California; L=San Jose; O=Cisco Systems; OU=Cisco XNC; CN=Cisco XNC * SSL certificate verify result: self signed certificate (18), continuing anyway. } [5 bytes data] > POST /monitor/j_security_check;jsessionid=A7449BEB7CADE08D3C3EF182355A8F46 HTTP/1.1 > Host: 10.10.10.73:8443 > Cookie: JSESSIONID=A7449BEB7CADE08D3C3EF182355A8F46 > Origin: https://10.10.10.73:8443 > Accept-Encoding: gzip, deflate, br > Accept-Language: he-IL,he;q=0.9, en-US;q=0.8, en;q=0.7 > Upgrade-Insecure-Requests: 1 > User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36 > Content-Type: application/x-www-form-urlencoded > Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 > Cache-Control: max-age=0 > Referer: https://10.10.10.73:8443/monitor/ > Connection: keep-alive > Content-Length: 33 > } [33 bytes data] * upload completely sent off: 33 out of 33 bytes { [5 bytes data] < HTTP/1.1 302 Found < Location: https://10.10.10.73:8443/monitor/ < Content-Length: 0 < Date: Tue, 27 Feb 2018 16:54:34 GMT < Server: Cisco XNC < 100 33 0 0 100 33 0 33 0:00:01 --:--:-- 0:00:01 1434 * Connection #0 to host 10.10.10.73 left intact got cookies: ['JSESSIONID=7BB26970C54BE3CFF2D0A7105F3F227E', 'JSESSIONIDSSO=9D47C3E4CD6A9923A058336B1DBFAB06'] https://10.10.10.73:8443/controller/nb/v2/monitor/filter/test_me_2 Data: {'networkDst': '', 'protocol': '', 'vlanPriority': '', 'etherType': '0x0800', 'transportPortSrc': '', 'udfInnerVlanName': '', 'httpMethodId': '', 'inUse': False, 'networkSrc': '', 'tosBits': '', 'isDefault': 'false', 'vlanId': '102', 'udfInnerVlan': 'false', 'bidirectional': 'false', 'tcpOptionLength': '', 'name': 'test_me_2', 'datalayerDst': '', 'udfMask': '', 'udfName': '', 'udfValue': '', 'transportPortDst': '', 'datalayerSrc': ''} /usr/lib/python2.7/dist-packages/urllib3/connectionpool.py:854: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning) Request: PUT https://10.10.10.73/controller/nb/v2/monitor/filter/test_me_2 Request headers: {'Content-Length': '307', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'User-Agent': 'python-requests/2.18.1', 'Connection': 'keep-alive', 'Cookie': 'JSESSIONIDSSO=9D47C3E4CD6A9923A058336B1DBFAB06; JSESSIONID=7BB26970C54BE3CFF2D0A7105F3F227E', 'Content-Type': 'application/json'} Response Status Code: 401 Response Content: <html> <head><title>401 Authorization Required</title></head> <body bgcolor="white"> <center><h1>401 Authorization Required</h1></center> <hr><center>nginx/1.7.10</center> </body> </html> 2018-02-27_18:56:34 | ERROR | Failed to add_or_modify_a_filter

 

0 Replies 0

Review Cisco Networking for a $25 gift card