0

перемещение примера Discord в отдельную папку

This commit is contained in:
2022-04-17 15:09:10 +03:00
parent 5f1c2296d1
commit 0ff46185c2
18 changed files with 10 additions and 11 deletions

36
discord/README.MD Normal file
View File

@@ -0,0 +1,36 @@
# Spring Boot + OAuth2 Discord
<img alt="Spring Boot" width="auto" height="100" src="https://spring.io/images/spring-initializr-4291cc0115eb104348717b82161a81de.svg">
<img alt="Discord" width="auto" height="100" src="https://www.freepngimg.com/thumb/computer/94317-teamspeak-discord-servers-computer-facial-smile-expression.png">
## Перед запуском
### Создание Discord Application
Для запуска понадобиться обзавестить своим **Discord Application**.
1. Переходим на [Discord Developer Portal](https://discord.com/developers/applications)
2. Создаём новое приложение
![](docs/1.png)
3. Переходим в раздел OAuth2
![](docs/2.png)
4. Добавляем адрес `http://127.0.0.1:8080/login/oauth2/code/discord` как адрес переадресации при успешной авторизации
![](docs/3.png)
![](docs/4.png)
5. Создаём **Client Secret**
![](docs/5.png)
![](docs/6.png)
6. Не забываем сохранить внесённые изменения!
![](docs/7.png)
### Настройка Spring
Открываем файл `src/main/resources/application.yml` и указываем там **Client ID** и **Client Secret**,
которые были указаны в разделе **OAuth2**:
```yaml
spring:
security:
oauth2:
client:
registration:
discord:
client-id: 965013316982423632
client-secret: yhb13RP26WxfOru9fcQ6CxPcAUWr_2q6
```