0
Files
spring-oauth2-examples/github

Spring Boot + OAuth2 GitHub

Spring Boot Discord

Перед запуском

Создание OAuth App

Для запуска понадобиться обзавестить своим GitHub OAuth App.

  1. Переходим в Developer settings
  2. Создём новое OAuth приложение
  3. Заполняем обязательно следующие поля
    • Homepage URL: http://127.0.0.1:8080
    • Authorization callback URL: http://127.0.0.1:8080/login/oauth2/code/github
  4. Сгенерировать новый Client secrets

Настройка Spring

Открываем файл src/main/resources/application.yml и указываем там Client ID и Client secrets:

spring:
  security:
    oauth2:
      client:
        registration:
          github:
            client-id: f9bbf16cc3a93663282f
            client-secret: 16f203668e25bfe44513d2a7b4925d62bb100783