Authentication
1. Initiate Discord Login
POST
/auth/discord-start
{ "client_id": "string", "redirect_uri": "string", "discord_scopes": ["identify", "guilds.join"], "twitter_token": "string" }
200 OK
{ "auth_url": "https://discord.com/oauth2/authorize?client_id=1...", "state": "secure_random_string", "session_token": "temporary_session_key" }
Node.js Example
const response = await fetch('https://api.devportal.auth/discord-start', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_SDK_TOKEN'
},
body: JSON.stringify({
client_id: 'your-discord-bot-id',
redirect_uri: 'https://yourapp.auth/callback',
twitter_token: 'TwitterOAuth2TokenFromUser'
})
});
⚠️ Security Note: The Twitter bearer token should be obtained via secure OAuth2 flow and never transmitted insecurely.