How to authenticate to the API

Introduction

It is not yet possible to authenticate to the SecureEdge with an API token. Instead, you can use the login endpoint to authenticate an application using the admin credentials printed on the side of your SecureEdge.

You need to capture the id cookie. All provided examples use cURL to interact with the SecureEdge. See https://curl.se/docs/http-cookies.html for a detailed guide on how to use HTTP cookies with cURL. Once you are logged in, you can pass the cookie in several ways to the other endpoints:

  • pass --cookie 'id=KjS1NvvocgJsUT+DTBxAeqqlbVDIxWO/Kx7B7U4Gngk=f2n-J1xC6tdydlvoQSVmyg' with each request, where the actual id cookie corresponds to the one received from your login
  • pass --cookie session.jar to have cURL read the session id cookie from the cookie jar

For simplicity's sake, the rest of this guide will use the cookie jar method. Do not forget to remove the cookie jar when you are done! Anyone that has your cookie jar can interact freely with your SecureEdge.

Usage

Authenticate with the SecureEdge APIby providing the credentials via Form values. The username is always admin, the password can be found on the sticker on the side of the SecureEdge:

curl --request POST \
     --url 'http://192.168.140.1:80/auth/login' \
     --cookie-jar 'session.jar' \
     --data 'username=admin' \
     --data 'password=f00b@rb@zqux'

Your session.jar should include an id cookie with your session credentials:

# Netscape HTTP Cookie File
# https://curl.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.

#HttpOnly_192.168.140.1 FALSE   /       FALSE   1734611407      id      KjS1NvvocgJsUT+DTBxAeqqlbVDIxWO/Kx7B7U4Gngk=f2n-J1xC6tdydlvoQSVmyg