: Authenticate Your API Requests
Focus
Focus

Authenticate Your API Requests

Table of Contents

Authenticate Your API Requests

Authenticate your API Re quests for PAN-OS firewalls.
Palo Alto Networks encourages you to authenticate your API requests by including a basic authentication token in the header of your requests. The basic authentication header can be used to authenticate both XML and REST API requests.
  1. Convert your user name and password to Base64 format.
    Example: username:password converts to dXNlcm5hbWU6cGFzc3dvcmQ=
  2. When making a request to the firewall, include the base64 converted token in the header preceded by Authorization: Basic
    Example:
    curl -X POST 'https://<firewall>/api?&type=config&action=get&xpath=/config/devices/entry[@name=%27localhost.localdomain%27]/network/interface/ethernet' -H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='
  3. Include the header in each of the subsequent requests to the firewall.