Overview
The Login API allows users to authenticate with FluxRPC using various providers. This unified endpoint supports multiple authentication methods including Google, GitHub, and Solana wallet.
Base URL
https://api.fluxbeam.xyz
Request
Endpoint
POST /auth/login
Headers
| Name | Required | Description |
|---|---|---|
| Content-Type | Yes | application/json |
Request Body
The request body varies depending on the authentication provider:
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | Authentication provider type ("google", "github", "solana", "password") |
| username | string | Conditional | Required for password authentication |
| wallet | string | Conditional | Required for Solana wallet authentication |
| code | string | Conditional | Required for OAuth providers (Google, GitHub) |
Example Request
OAuth (Google/GitHub) Example:
{
"type": "google",
"code": "4/0AeaYSHDh_Dj8kTYrRZcHktmL-0Ej..."
}
Solana Wallet Example:
{
"type": "solana",
"wallet": "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",
"signature": "5cLLMR9GZeGj2JP7..."
}
Password Example:
{
"type": "password",
"username": "user@example.com",
"password": "securepassword123"
}
Response
Success Response (200 OK)
{
"success": true,
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user": {
"id": "user-uuid-here",
"email": "user@example.com",
"name": "User Name",
"avatar": "https://example.com/avatar.jpg"
}
}
}
Error Responses
401 Unauthorized
{
"success": false,
"error": "Invalid credentials"
}
400 Bad Request
{
"success": false,
"error": "Missing required parameters"
}
Usage Notes
- The returned JWT token should be included in the Authorization header for subsequent API requests.
- Tokens have a limited lifetime. Use the refresh token endpoint to obtain a new token when needed.
- For Solana wallet authentication, you'll need to sign a message with your wallet. First, get the nonce using the
/auth/login/solanaendpoint, sign it, and then submit the signature with this endpoint.
Performance
As with all FluxRPC endpoints, the authentication API is optimized for speed and reliability. Authentication requests typically complete in under 100ms, making FluxRPC the fastest RPC service on Solana.