Skip to main content
The Network Simulation API uses bearer token authentication. All API requests require a valid JWT token in the Authorization header.

Obtaining a Token

Using the CLI

The simplest way to get a token for development is using the CLI:

Programmatic Token Generation (M2M)

For machine-to-machine authentication, use OAuth 2.0 client credentials flow with AWS Cognito:
Response:
Contact your administrator for Cognito client credentials.

Using Your Token

Include the token in the Authorization header:

Authentication Errors

401 Unauthorized

Returned when:
  • No token is provided
  • The token is invalid or malformed
  • The token has expired

403 Forbidden

Returned when the token is valid but lacks permission for the requested resource:

Token Best Practices

  1. Store securely - Use environment variables or a secrets manager
  2. Rotate regularly - Tokens expire after 1 hour by default; refresh before expiry
  3. Never log tokens - Ensure your logging doesn’t capture authentication headers
  4. Use HTTPS in production - Tokens should never be sent over unencrypted connections

Environment Variable Example

Set your token as an environment variable:
Then use it in your scripts:

SDK Authentication

If using the Rust SDK, configure the client with your token:
See the SDK Guide for more details.