0
Files
spring-oauth2-examples/twitch/README.MD

43 lines
1.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Spring Boot + OAuth2 Twitch
<img alt="Spring Boot" width="auto" height="100" src="../docs/spring-boot.svg">
<img alt="Spring Boot" width="auto" height="100" src="docs/twitch.svg">
## Перед запуском
### Создание Application
Для запуска понадобиться обзавестить своим **Twitch Application**.
1. Переходим в [Twitch Developers](https://dev.twitch.tv/console)
2. Создаём новое OAuth приложение
![](docs/1.png)
3. Заполняем поля
⚠️ **Внимание!** Есть ряд ограничений.
Для **Name**:
- Не должен содежрать слово "twitch"
Для **OAuth Redirect URLs**:
- Если запуск **не** локальный, требуется HTTPS протокол
- Если запуск локальный, то вводить не `127.0.0.1`, а `localhost`
![](docs/2.png)
4. После переходим в управление приложением
![](docs/3.png)
5. Сгенерировать новый **Client Secret**
![](docs/4.png)
![](docs/5.png)
### Настройка Spring
Открываем файл `src/main/resources/application.yml` и указываем там **Client ID** и **Client Secret**:
```yaml
spring:
security:
oauth2:
client:
registration:
twitch:
client-id: 89fwqw0i5b9857n5orpz3sb3dyfhti
client-secret: mlatyu8twmzq69mx0um1hbahfi7p31
```