cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1184
Views
15
Helpful
3
Replies

Postman can't authenticate in the SD-Access- DNAC

Kalika
Level 1
Level 1

Hi,

I have trying many times to add the DNAC as environment with Postman tool  but can't authenticate with the DNAC, even i have wrote right username and password, is it anyone had this issue before.

3 Replies 3

Tomas de Leon
Cisco Employee
Cisco Employee

Here is an example:

POSTMAN_On_MACOSX_00a.png

POSTMAN_On_MACOSX_01a.png

POSTMAN_On_MACOSX_02a.png

   

Mohamed Alhenawy
Spotlight
Spotlight

 

choose the type of authentication as  {Basic-Auth} also disable the ssl certificate verification 

 

Please read my previous article will help you a little

 

https://community.cisco.com/t5/networking-documents/automation-tool-quot-postman-quot-with-cisco-digital-network/ta-p/4099564

 

Mike.Cifelli
VIP Alumni
VIP Alumni

If using an off box python script this function can aide in getting the auth token.  Just call it when needed:

def get_token():
API_URL = 'https://<dnac node>/api/system/v1/identitymgmt/token'
AUTH = '<user>','<pass>'
HEADER = {'content-type': 'application/json'}

r = requests.post(url=API_URL, auth=AUTH, headers=HEADER, verify=False)

data = r.text
key = json.loads(data)
token = key['Token']
print "DNAC Auth Token"
print token
return token

Then in other functions to call get_token you can do something like this:

..snippet..
data = get_token()

  API_URL = 'https://<dnac node>/dna/intent/api/v1/network-device/'
AUTH = {
'X-Auth-Token' : data,
'Content-type' : 'application/json'
}

HTH!