Skip to main content

Overview

SuperBox uses Firebase Authentication with JWT (JSON Web Tokens) for secure API access. All authenticated endpoints require a valid Bearer token in the Authorization header.

Authentication Method

Firebase JWT Bearer Token Authentication

Getting Your API Token

1

Create an Account

Sign up at SuperBox using one of our supported providers:

Google

Sign in with Google

GitHub

Sign in with GitHub

Email

Email/Password
2

Navigate to Settings

Go to your Profile Settings page.
3

Generate API Token

Click “Generate API Token” to create a new authentication token.
This token will only be shown once. Store it securely!
4

Copy and Store

Copy your token and store it in a secure location like:
  • Environment variables
  • Secure password manager
  • Encrypted configuration file
Never commit tokens to version control or share them publicly.

Using Your Token

Store your token in an environment variable:
Then reference it in your code:

Direct Usage

For testing or development, you can use the token directly:

Authentication Flow

Token Validation

When you make an authenticated request, the API validates your token:
1

Extract Token

API extracts the Bearer token from the Authorization header
2

Verify Signature

Token signature is verified using Firebase public keys
3

Check Expiration

Token expiration time is checked
4

Extract Claims

User ID and other claims are extracted from the token
5

Authorize Request

User permissions are checked for the requested resource

Token Structure

Firebase JWT tokens contain three parts separated by dots:

Token Payload Example

string
Unique user identifier
string
User’s email address
integer
Token expiration timestamp (Unix time)
integer
Token issued at timestamp (Unix time)

Token Expiration

Token Lifetime

Firebase tokens expire after 1 hour (3600 seconds)
When a token expires, you’ll receive a 401 Unauthorized response:

Automatic Token Refresh

The SuperBox frontend automatically refreshes tokens before they expire. For API clients, implement token refresh logic:

Public vs Authenticated Endpoints

These endpoints don’t require authentication:
public
List all servers (read-only)
public
Get server details (read-only)
Public endpoints have stricter rate limits (100 req/hour)

Permission Levels

SuperBox implements resource-level permissions:
All authenticated users can read any server’s information
Only the server owner can update their server’s metadata
Only the server owner can delete their server
SuperBox admins can modify or delete any server

Error Responses

Missing Token

Invalid Token

Expired Token

Insufficient Permissions

Best Practices

  • Use environment variables - Never hardcode tokens in source code - Don’t commit tokens to version control - Use secret management services (AWS Secrets Manager, HashiCorp Vault)
  • Check token expiry before requests - Refresh tokens proactively (5 min before expiry) - Handle 401 responses gracefully - Retry failed requests after refresh
  • Always use HTTPS for API requests - Never send tokens over unencrypted connections - Validate SSL certificates
  • Generate new tokens periodically - Revoke old tokens after rotation - Monitor token usage for anomalies
  • Set up alerts for unusual activity - Review access logs regularly - Revoke compromised tokens immediately

SDK Authentication

Using our official SDKs simplifies authentication:

Testing Authentication

Test your authentication setup:
You’re all set! You now know how to authenticate with the SuperBox API.

Next Steps

Create Your First Server

Deploy an MCP server using authenticated endpoints

Error Handling

Learn how to handle authentication errors