Fluxer supports OAuth2 for third-party application authorization, allowing users to grant limited access to their accounts without sharing credentials.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/fluxerapp/fluxer/llms.txt
Use this file to discover all available pages before exploring further.
OAuth2 Scopes
Scopes define what resources an application can access:Scope Descriptions
identify
identify
Basic user informationAccess to:
- User ID
- Username
- Avatar
- Discriminator
- Public flags
email
User email addressIncludes:
- Email address
- Verification status
guilds
guilds
User’s guildsAccess to:
- Guild list
- Guild names
- Guild icons
- User’s permissions
connections
connections
User’s connected accountsAccess to:
- Connected services (GitHub, Twitter, etc.)
- Connection metadata
bot
bot
Add bot to guildsAllows:
- Adding the bot to guilds the user has
MANAGE_GUILDpermission in - Joining guilds via invite links
This scope is only valid for bot applications
admin
admin
Administrative accessFull access to:
- All user data
- Administrative endpoints
- Sensitive operations
Authorization Flow
1. Authorization URL
Redirect users to the authorization endpoint:2. Authorization Grant
User approves the authorization request. Fluxer redirects to yourredirect_uri:
3. Token Exchange
Exchange the authorization code for an access token:4. Accessing Resources
Use the access token to make API requests:Token Refresh
Access tokens expire after 7 days. Use the refresh token to obtain a new access token:State Parameter
Thestate parameter prevents CSRF attacks:
Error Handling
Authorization Errors
Fluxer redirects to yourredirect_uri with error parameters:
| Code | Description |
|---|---|
invalid_request | Missing or invalid parameters |
unauthorized_client | Client not authorized for this grant type |
access_denied | User denied the authorization request |
unsupported_response_type | Authorization server doesn’t support this response type |
invalid_scope | Requested scope is invalid or unknown |
server_error | Internal server error |
temporarily_unavailable | Authorization server is temporarily unavailable |
Token Errors
400 Bad Request
Scope Validation
Validate that your token has required scopes:Rate Limits
OAuth2 endpoints have specific rate limits:| Endpoint | Limit | Window |
|---|---|---|
/oauth2/authorize | 10 | 10 seconds |
/oauth2/token | 10 | 10 seconds |
/oauth2/revoke | 10 | 10 seconds |
Bot Applications
Bot Scope
Bot applications require thebot scope:
Must include
botBitwise permission value to request (optional)
Pre-select a guild for the user (optional)
Bot Token Format
Bot tokens use a different format:Authorization header:
Security Best Practices
Never Expose Client Secret
Keep your client secret secure. Never include it in client-side code or version control.
Validate State Parameter
Always validate the
state parameter to prevent CSRF attacks.Use HTTPS
Only use OAuth2 over HTTPS. Never send credentials over unencrypted connections.
Minimal Scopes
Request only the scopes your application actually needs.
Token Storage
Store tokens securely. Use encryption for sensitive storage (databases, cookies).
Token Rotation
Rotate refresh tokens regularly and invalidate old tokens when new ones are issued.
OAuth2 Errors
Missing Scope Error
403 Forbidden
Client Credentials Flow
For server-to-server authentication:Client credentials flow is typically used for bot applications making API requests without user context.