-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from arthurpar06/addOauthDocs
Add docs for OAuth
- Loading branch information
Showing
6 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
id: discord | ||
title: Discord | ||
sidebar_title: Discord | ||
--- | ||
|
||
First, you need to [create a developer application](https://discord.com/developers/applications) on the Discord website. If you have already created this application to use the rich presence of vmsACARS, you can use the same one. | ||
|
||
Next, go to OAuth2 > General. Copy the client ID and client secret to be used in the configuration later. Additionally, you need to add a redirect; the URL to add is `https://yourdomain.com/oauth/discord/callback`. | ||
|
||
![](img/create-discord.png) | ||
|
||
In the `.env` file, add the following: | ||
|
||
```shell title=".env" | ||
DISCORD_OAUTH_ENABLED=true | ||
DISCORD_CLIENT_ID={your_client_id_copied_before} | ||
DISCORD_CLIENT_SECRET={your_client_secret_copied_before} | ||
``` | ||
|
||
Now, your users can link their Discord account to their phpVMS account and use their Discord account to log in. The link between the two accounts is automatically established when clicking the "Login with Discord" button on the login page. However, if the email address of the Discord account is different from the email address of the phpVMS account, it must be done manually on the profile page. | ||
|
||
## Sending Private Messages | ||
|
||
If you want to send private message notifications to your users (development still in progress), you need to create a Discord bot in the bot section of your Discord application and copy the token. <br/> | ||
If this option is not enabled, the `discord_private_channel_id` field will not be filled. This field contains a unique discussion ID between the bot and the user, so it is imperative to have a bot to fill it. | ||
|
||
![](img/create-discord-bot.png) | ||
|
||
Place the token in the `.env`: | ||
|
||
```shell title=".env" | ||
DISCORD_BOT_TOKEN={your_bot_token_copied_before} | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
id: vatsim | ||
title: VATSIM | ||
sidebar_title: VATSIM | ||
--- | ||
|
||
First, you need to [create a vatsim organization](https://auth.vatsim.net/organization/requirements) on the VATSIM website. | ||
|
||
After your organization has been approved by VATSIM, you can create a new OAuth client. | ||
Go to the [Organizations](https://auth-dev.vatsim.net/organization) tab and into the organization you created. Navigate to the 'OAuth clients' tab and add a new client. | ||
In the redirect URL, enter: `https://yourdomain.com/oauth/vatsim/callback` | ||
|
||
![](img/create-vatsim.png) | ||
|
||
In the `.env` file, add the following: | ||
|
||
```shell title=".env" | ||
VATSIM_OAUTH_ENABLED=true | ||
VATSIM_CLIENT_ID={your_client_id} | ||
VATSIM_CLIENT_SECRET={your_client_secret} | ||
``` | ||
You can retrieve your client ID and your client secret from the OAuth clients page after creating the client as explained above. | ||
|
||
Now, your users can link their VATSIM account to their phpVMS account and use their VATSIM account to log in. The link between the two accounts is automatically established when clicking the "Login with VATSIM" button on the login page. However, if the email address of the VATSIM account is different from the email address of the phpVMS account, it must be done manually on the profile page. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters