Skip to main content

Overview

Cryptorobot.ai supports multiple authentication strategies:

Login (Local Strategy)

Exchange email and password for a JWT access token:

Response

Using the Token

Include the JWT token in the Authorization header for all authenticated requests:
Tokens expire after a configured TTL (default: 7 days). When a token expires, you’ll receive a 401 Not Authenticated error. Re-authenticate to get a fresh token.

Token Refresh

Tokens can be refreshed by authenticating with the existing (still valid) token:

Google OAuth

For web applications, redirect users to the Google OAuth flow:
After successful authentication, the user is redirected to your callback URL with the JWT token.

Logout

Invalidate the current session:
This revokes the session server-side. The JWT will be rejected on subsequent requests.

Session Management

List active sessions for the current user:

Security Best Practices

Never expose JWT tokens in client-side JavaScript, URLs, or logs. Use httpOnly cookies or secure storage mechanisms.
For automated trading bots and server-to-server communication, use API keys instead of user credentials.
Periodically rotate API keys and re-authenticate to minimize exposure from leaked credentials.
All API requests must use HTTPS. HTTP requests are rejected.

Email Verification

New accounts must verify their email before full access is granted:

Password Reset