cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2778
Views
1
Helpful
1
Replies

Can't access APIC App REST endpoints - URL Challenge Token empty

kuschauh
Cisco Employee
Cisco Employee

I’m trying to access the app api, as declared in app.json but the validation seems to be failing.

 

I’m doing a GET call at https://<apic_address>/appcenter/Cisco/StateChangeChecker/proxy.json

and I get the following response :

 

{"totalCount":"1","imdata":[{"error":{"attributes":{"code":"403","text":"Token was invalid (Error: WebToken validation passed but URL Challenge Token was empty)"}}}]}

 

 

For clarity, this is what I’m doing :

 

client_url = apic_url + "/appcenter/Cisco/StateChangeChecker/proxy.json"
headers = {    'DevCookie': cookie,
    'APIC-challenge': challenge}
response = session.get(client_url, headers=headers, verify=False)
print(response.text)

I get the cookie and challenge from doing a aaaLogin.

aaaLogin is working fine because I can make a call to "https://<apic_address>/api/class/topSystem.json" and I get the expected response.

 

Am I missing something here?

1 Accepted Solution

Accepted Solutions

kuschauh
Cisco Employee
Cisco Employee

Still not sure what's wrong with my code making the requests but for anyone else, the problem was that the DevCookie wasn't being set right.

View solution in original post

1 Reply 1

kuschauh
Cisco Employee
Cisco Employee

Still not sure what's wrong with my code making the requests but for anyone else, the problem was that the DevCookie wasn't being set right.