Totally stuck getting started. Constant 403 responses

Reply
L0 Member

Totally stuck getting started. Constant 403 responses

Howdy all. I'm trying to get started with some API work on my PAN instances in AWS. I walked through the Getting Started guide for 8.0 and I created a user, assigned an Admin Profile to it that had API access, and then generated a key.  Seems pretty simple but no matter what I do, every request is coming back 403:

 

curl -k 'https://w.x.y.z//api/?type=op&cmd=<show><system><info></info></system></show>&key=LUFRPT0zTG5aOUEvbF...'
<response status = 'error' code = '403'><result><msg>Invalid credentials.</msg></result></response>

 

I've changed the password, I've recreated the user, i've redone the key after password changes. Nothing works. I have to be missing something simple.  Can anyone provide me some guidance?  I can't even figure out how to get to logfiles that would provide any debug output about why the user is getting rejected.

 

Screen Shot 2018-01-30 at 11.26.03 AM.pngScreen Shot 2018-01-30 at 11.26.22 AM.png

L4 Transporter

Re: Totally stuck getting started. Constant 403 responses

I'll try to recreate this on one of our AWS instances. The only thing that comes to mind beforehand is to make sure the API key generation was successful. Sometimes a special character is at the end of the API key and I've notice when I select the text in my browser it misses the special character.

L0 Member

Re: Totally stuck getting started. Constant 403 responses

OMG!!! You are a f'in genius!  I have stared at this thing for 2 days and never even noticed the character at the end that my copy and paste wasn't picking up.

 

homer.jpg

L4 Transporter

Re: Totally stuck getting started. Constant 403 responses

Glad it was an easy one, though it's definitely something that has stumped me before. :)

Re: Totally stuck getting started. Constant 403 responses

Hello,

can you help me, what I am doing wrong?

 

curl -k 'https://firewall/api/?type=keygen&user=xmladmin&password=password'
<response status = 'success'><result><key>LUFRPT1tajdzYWdOL2wrcDR0ckNIb0hNR2N2Wnc0VTg9M053bFoyTngydmpWUFhPOGttTWd0Q21EN1lyYngreWFXVktGc2F3MjNHQT0=</key></result></response> 
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

 ➤ curl -k 'https://firewall/api/?type=op&cmd=<show><system><info></info></system></show>&api=LUFRPT1tajdzYWdOL2wrcDR0ckNIb0hNR2N2Wnc0VTg9M053bFoyTngydmpWUFhPOGttTWd0Q21EN1lyYngreWFXVktGc2F3MjNHQT0='
<response status = 'error' code = '403'><result><msg>Invalid credentials.</msg></result></response>

 

 

Thank you in advance

L4 Transporter

Re: Totally stuck getting started. Constant 403 responses

The name of the API key parameter is key, not api. So change the part preceding your key with &key= instead of &api=

Highlighted

Re: Totally stuck getting started. Constant 403 responses

silly me!

I was looking for mistake in any other places, 

thank you!

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the Live Community as a whole!

The Live Community thanks you for your participation!