Skip to main content

Cloud-Cloud

The cloud-cloud authentication uses JSON Web Tokens for secure communication between your cloud systems and the Powernaut platform.

Security

Never hardcode these credentials on edge devices. Cloud-cloud credentials provide full access to your account and should only be used in secure cloud environments. Use Edge-Cloud Authentication for devices instead.

OAuth

Our cloud-cloud authentication is compatible with OAuth 2.0. You can use any OAuth 2.0 compatible library to fetch a token.

Getting a Token​

You need to fetch an access token using the token endpoint with your client ID and secret.

Use Basic Authentication by including the credentials in the Authorization header. Concatenate the client ID and secret with a colon (:) and encode with Base64:

Authorization: Basic <base64(key:secret)>
import requests

url = "https://api.powernaut.io/v1/auth/token"

payload = {}
headers = {
'Accept': 'application/json',
'Authorization': 'Basic <credentials>'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
info

Given our private beta, credentials are currently only accessible upon request.

Send an email to us for early access.

Using the Token​

Include the token in the Authorization HTTP header of all API requests, preceded with Bearer and a space:

Authorization: Bearer <token>

For example, to list all sites:

import requests

url = "https://api.powernaut.io/v1/connect/sites?page=1&page_size=10"

payload = {}
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer <token>'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)