Steps
1) Downloading the discord auth files
- Navigate to github.com/mbround18/foundryvtt-discord-auth.
- Click on the green code button:
- Click Download as zip
2) Extract the files to the foundry installation directory.
Either with a gui client such as 7zip or with terminal, extract the files to the path/to/foundry/resources/app
directory. (where the main.js
file is located)
Depending on what client you are using, it will ask to overwrite the main.hbs
file. This is acceptable as the only modification to the original file is to load the discord script.
3) Create a new application on Discord
- Navigate to discord developers section
- Log into your discord account if needed.
- Either modify an existing application or create a new application.
4) Adding the Callback.
- Click the OAuth2 tab under your application
- Click the Add Redirect button and add your foundrys url with
/join
at the end of it. - Click the save button.
5) Modify the discord.js
script.
- While on your discord applications page, copy the application ID.
- Now open and edit the file
public/scripts/discord.js
If you are using the application for windows, mac, Linux, etc it might be under path/to/foundry/resources/app/public/scripts/discord.js
- At the top of the file you will see the following configuration:
- Change the client ID to the one you have stored in your clipboard.
- Change the callback URL to match the one you saved in the redirects section on the discord developer portal.
- (Optional) You can choose to use
id, email
or justid
if you want to simplify adding new users.
6) Setting up the discord authentication in your browser.
- Navigate to your Foundry url.
- Launch your world.
- Log in as Gamemaster or your GM account.
- Navigate to the user management screen
- You will now see several new fields, change the User Name to be your discord username. (If you click on your username in the discord application it will copy it to clipboard.)
- Set the discord ID to be your Discord ID. (You can get this by following this guide)
- Add the email for yourself.
- Set the access key.
- (Optional) Repeat steps 5 through 8 for each user.
- Click Save and Return
If you opted to only use Discord ID or Email, your form will look different.
Log in with Discord
Logging in for the first time
- Click the Log in with Discord button
- Authorize the application.
- Enter your access key.
Returning to Foundry
- Enter your access key.
Top comments (0)