Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[✅ STAMP REQUEST] Discord #11

Open
codingshot opened this issue Jan 29, 2024 · 0 comments
Open

[✅ STAMP REQUEST] Discord #11

codingshot opened this issue Jan 29, 2024 · 0 comments
Labels
stamp-request Request for a sybil check/stamp

Comments

@codingshot
Copy link
Member

codingshot commented Jan 29, 2024

Name of Check

Discord Authentication

Desired Performance of Check

  • verify discord account

Qualified Leads for Development

  • Collab.land, NEP Boat, Tradeport (has discord bot)

Associated Costs

Acceptance Criterion

  1. Register Your Application
    First, you need to register your application with Discord:

Go to the Discord Developer Portal: Discord Developer Portal
Create a New Application: Click on the "New Application" button.
Name Your Application: Give it a name and confirm.
2. Set Up OAuth2
In the Discord Developer Portal, configure OAuth2 for your application:

Select Your Application: Click on your newly created application.
Navigate to OAuth2: Go to the "OAuth2" tab.
Add Redirect URIs: Under "Redirects", add the URL(s) where users will be redirected after authentication. This must match the URL in your application where Discord will send the authentication code.
3. Obtain Client ID and Secret
Still in the OAuth2 section, you will find your Client ID and Client Secret. These are important for your application's authentication process:

Client ID: Publicly used to identify your application.
Client Secret: A private key, keep it secure.
4. Implement OAuth2 in Your Application
Integrate OAuth2 in your app. This will require coding:

Authorization URL: Redirect users to the Discord authorization URL with necessary query parameters:

client_id: Your application's client ID.
redirect_uri: One of the redirect URIs you set up in the Discord Developer Portal.
response_type: Should be code.
scope: Define the level of access you need (e.g., identify, email).
Example URL:

bash
Copy code
https://discord.com/api/oauth2/authorize?client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&response_type=code&scope=identify%20email
Handling the Redirect: Your application needs to handle the redirect URI. It will receive a code parameter.

Exchange Code for Token: Make a POST request to Discord's token URL to exchange the code for an access token.

URL: https://discord.com/api/oauth2/token
Include form parameters: client_id, client_secret, grant_type (should be authorization_code), code (the one received), and redirect_uri.
Use the Token: Use the access token to make API requests to Discord to retrieve user information.

  1. Implement Security Measures
    Ensure the security of the authentication process:

Validate Tokens: Always validate access tokens.
Secure Redirect URIs: Make sure your redirect URIs use HTTPS.
Protect Client Secret: Never expose your client secret in client-side code.
6. Build User Interface
Create a user-friendly interface in your application for users to log in via Discord. The interface should guide users through the OAuth2 process.

  1. Test Your Application
    Thoroughly test the authentication flow to ensure it works smoothly and securely.

  2. Handle User Data Responsibly
    Follow best practices and legal requirements (like GDPR, if applicable) in handling and storing user data.

Additional Notes:
Languages and Frameworks: The implementation details will vary based on the programming language and framework you're using. There are libraries available for popular languages that can make this process easier.
Documentation: Refer to Discord's OAuth2 documentation for more detailed information.

Impact on Sybil Ecosystem

Verification and Rate Limiting: Discord requires new users and bots to verify their accounts, often through a phone number or email address. This helps to reduce the number of spam or malicious accounts. Additionally, Discord imposes rate limits on actions such as sending messages, joining servers, or adding friends, which makes it harder for bots to perform spammy or abusive actions rapidly.

CAPTCHA for New Users: For suspected bot accounts or in cases of unusual activity, Discord may require the completion of a CAPTCHA challenge. This is an effective way to distinguish between human users and automated bots.

Limitations / Risks

@codingshot codingshot added the stamp-request Request for a sybil check/stamp label Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stamp-request Request for a sybil check/stamp
Projects
Status: Ideating
Development

No branches or pull requests

1 participant