-
Notifications
You must be signed in to change notification settings - Fork 4
Authentication setup
khakers edited this page Mar 24, 2023
·
2 revisions
- Navigate to the Discord Developer Portal
- Open the application you created for modmail (or an application of your choice)
- open the OAuth2 section
- You'll need to set the environment variable
MODMAIL_VIEWER_DISCORD_OAUTH_CLIENT_ID
to your client ID shown on the page, andMODMAIL_VIEWER_DISCORD_OAUTH_CLIENT_SECRET
to the Client Secret next to it. - Now, add the URL your modmail-viewer instance will be available at to the redirects with
/callback
appended. This url should be the same as what you setMODMAIL_VIEWER_URL
to (except with /callback added, of course).
Make sure to save your changes.
Now you'll need to generate a proper secret key for saving authentication, to be secure, it should be at least 32 characters. Make sure you keep this secure and don't share it, as anyone can use it to make authentication tokens. Once done, set it with the MODMAIL_VIEWER_SECRETKEY
environment variable.
Finally, set MODMAIL_VIEWER_DISCORD_GUILD_ID
to guild ID you plan on using for authentication. It's probably the same as what you've already set for modmail.
You should now have the following environment variables set:
- MODMAIL_VIEWER_DISCORD_OAUTH_CLIENT_ID
- MODMAIL_VIEWER_DISCORD_OAUTH_CLIENT_SECRET
- MODMAIL_VIEWER_DISCORD_GUILD_ID
- MODMAIL_VIEWER_SECRETKEY