Edge API Authentication
The Edge API authentication is based on the OpenID Connect (OIDC), which is an open authentication protocol that works on top of the OAuth 3.0 framework.
Authentication tokens are issued by a pre-registered user on the Edge computer. It uses a username and password to obtain a valid JWT token. This method should be used by a common user.
In the methods below we use cURL for the examples. When using Swagger UI or Postman the principle is the same but you will have to follow specific instructions for the software to obtain and use the tokens in OAUTH2 format.
User Authentication
A JWT token can be obtained using the following endpoint:
/auth/token/get
With application/x-www-form-urlencoded request parameters:
username: Edge computer's EdgeAPI usernamepassword: Edge computer's EdgeAPI password
The response returns an access_token, expires_in and token_type keys.
Using cURL from a command line, you would do this;
This is a http connection. There is no encryption on this connection. If you want to remotely connect, ensure you use a VPN or SSL connection to ensure security over a network.
curl -X 'POST' \
'http://<edge-computer-ip-address>:30000/api/v4/auth/token/get' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"username": "admin",
"password": "admin"
}'
{
"access_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJlZGdlLWFwaSIsImV4cCI6MTcyMTA2NDU0NCwiaWF0IjoxNzIxMDYwOTQ0fQ.m3V9s5R3MxR-hXD4rb4jnJkodEwITv35BueBTthSGY0",
"expires_in":3600,
"token_type":"Bearer"
}
The access_token should be used as the Bearer credential in all HTTP requests to the Edge API with the following header: Authorization: Bearer <access_token>.
Example of using the access token in the header of a request:
curl -X 'GET' \
'http://<edge-computer-ip-address>:30000/api/v4/workloads/list' \
-H 'Authorization: Bearer <Your Current Token>' \
-H 'accept: application/json'
