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

Adding support for discord oauth verification #2710

Merged
merged 20 commits into from
May 13, 2024

Conversation

silva-fj
Copy link
Contributor

@silva-fj silva-fj commented May 8, 2024

This PR introduces a new option to verify discord accounts using OAuth2.0

The discord oauth 2.0 mechanism works a little differently than Twitter's, there is no need to generate a code challenge from our side so clients only need one interaction with the worker to link identities.

Just like with twitter, we need to register the redirect uri clients will use in the discord developer account.

As Kai suggested here #2641 (review), in the future, we could register these oauth clients in the parachain.

Important

  • There are 2 new environment variables needed for the Discord API needed for OAuth2.0: DISCORD_CLIENT_ID and DISCORD_CLIENT_SECRET.
  • The clients must use the following template link to present to their users https://discord.com/oauth2/authorize?client_id={DISCORD_CLIENT_ID}&response_type=code&redirect_uri={CLIENTS-REDIRECT-URI}&scope=identify.

@silva-fj silva-fj added the C0-breaking Breaking change that will cause existing client to break label May 8, 2024
@silva-fj silva-fj requested a review from a team May 8, 2024 15:59
Copy link

linear bot commented May 8, 2024

Copy link
Member

@kziemianek kziemianek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left small comments but overall it looks great 👍🏼

Copy link
Collaborator

@BillyWooo BillyWooo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Is there anything setup from our Discord server?

@silva-fj
Copy link
Contributor Author

LGTM. Is there anything setup from our Discord server?

We need to setup OAuth2 on the app we use or create a new app in the account and set it up to get the client id and client secret.

Copy link
Collaborator

@Kailai-Wang Kailai-Wang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, only have some small naming questions, otherwise it looks good

@silva-fj silva-fj merged commit a4f73b5 into dev May 13, 2024
33 checks passed
@silva-fj silva-fj deleted the p-723-implement-oauth-verification-for-discord branch May 13, 2024 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C0-breaking Breaking change that will cause existing client to break
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants