Authenticate
SD-WAN Edge uses a certificate authority (CA) certificate to enable clients to connect securely to the server. You access the SD-WAN Edge REST resources over HTTPS and you must provide the user name and password for your SD-WAN Edge account.
For example, to authenticate using cURL:
-
Set the cURL environment variable,
CURL_CA_BUNDLE
, to the location of your local CA certificate bundle. For information about CA certificate verification using cURL, see: http://curl.haxx.se/docs/sslcerts.html. -
Create a JSON file called
login.json
that contains the user name and password for your SD-WAN Edge account. -
Send the contents of
login.json
using the-d
option. -
Use the
-c <cookiefile>
option to create the cookie file that will be used in all subsequent requests. -
In subsequent requests, send the cookie with the
-b <cookiefile>
option. -
In POST requests, if the API requires a timestamp, send the timestamp received from the /login API.
Example
-
Export the IP address or fully qualified domain name to a variable.
export IPADDR='10.0.0.5'
-
Create the
login.json
file that contains the username and password.{ "login": { "username":"talariuser", "password":"<password>" } }
-
Authenticate.
curl -X POST \ -d@login.json \ -c cookies.txt \ --header "Content-Type: application/json" \ "https://$IPADDR/restapi/login"
The server response contains a timestamp.{ "status": "success", "user_level": 1, "user_level_str": "admin", "message": "Login Success - Created session for user talariuser - level: 1", "timestamp": "MTYwNzUyODk0MQ==" }
-
Save the timestamp to a file.
{ "timestamp": "MTYwNzUyODk0MQ==" }
-
In subsequent requests that require a timestamp, send the timestamp with the
-d@<timestamp file>
option.curl -X POST \ -d@timestamp.json \ -c cookies.txt \ --header "Content-Type: application/json" \ "https://$IPADDR/path/to/resource"