cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
2247
Views
0
Helpful
5
Replies
oslopez
Beginner

Can't obtain authentication token from Nexus 9000 Switch with Postman

Hello everyone,

I'm learning to use the NX-API REST via Postman. Currently I'm in the process of obtaining an authentication token from the NX9k switch following the below steps:

Capture.JPG  Since the switch I'm reaching uses TACACS as a method of authentication I assign "name" and "pwd" with my Tacacs credentials.

However, once I hit the SEND button I get the following error:

Capture2.JPG

(The actual Switch IP address is 10.18.1.2)

I tried the same steps in another switch with uses no TACACS but the default admin/admin credentials, however I got the same error.

Could you advise on why the connection is getting refused?

As mentioned, the Switch uses TACACS for authentication and the feature nxapi has been added.

 

Thank you.

 

1 ACCEPTED SOLUTION

Accepted Solutions

Well, I just wrote a Python script and I was able to login without any issue, so I would say this is a Postman issue. My goal is to eventually write Python scripts to manage/configure Cisco gear, therefore I will ditch Postman and will focus on Python scripting.

 

Thank you.

View solution in original post

5 REPLIES 5
Sergiu.Daniluk
VIP Advisor

HI @oslopez 

You are talking about NXAPI, however you are using ACI API login.

If you have your N9K switch running in NXOS mode, have a look here: https://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus9000/sw/6-x/programmability/guide/b_Cisco_Nexus_9000_Series_NX-OS_Programmability_Guide/b_Cisco_Nexus_9000_Series_NX-OS_Programmability_Guide_chapter_011.html

If you have an ACI fabric, use the APIC IP to login.

 

Stay safe,

Sergiu

 

Hi msdaniluk,

In fact, what I'm following is a lab at Ciscolive : 

http://opennxos.ciscolive.com/pod0/labs/lab3/lab3-m2

Already completed previous modules but currently I'm stuck at Module 2: Postman - NX-API REST with the error mentioned.

As far as I'm concerned, this lab is based on a N9K switch, not an ACI fabric, That's why I'm using a N9K switch. Already was able to access the Sandbox, but I'd like to get more proficient using Postman, that's why I'm trying to go through the authentication process.

 

 

Thanks for your help. 

 

 

 

 

Hello,

So it seems NXAPI REST is using same DME logic to access MO objects as in ACI. And curious enough is still called APIC Cookie ^_^.

Try this:

{
  "aaaUser" : {
    "attributes" : {
      "name" : "apic:TacacsDomain\\username",
      "pwd" : "password"
    }
  }
}

NOTE: I haven't tested it as I do not have a tacacs in the lab.

 

Stay safe,

Sergiu

I don't have the Tacacs domain but I used the actual IP address of the Tacacs server along with my Tacacs UN and PW

"name" : "apic:<ip address of Tacacs server>\\username

But unfortunately I'm still getting the same error

Well, I just wrote a Python script and I was able to login without any issue, so I would say this is a Postman issue. My goal is to eventually write Python scripts to manage/configure Cisco gear, therefore I will ditch Postman and will focus on Python scripting.

 

Thank you.

Create
Recognize Your Peers
Content for Community-Ad