From 2469bf0e4c198af559411bdbb27f65cdb2ef9cc9 Mon Sep 17 00:00:00 2001 From: kataus Date: Fri, 3 Jun 2022 19:02:36 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=B8=D0=BC=D0=B5=D1=80=20oAuth?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2022-02/spring-27/ACL/pom.xml | 2 +- 2022-02/spring-27/WebFlux/pom.xml | 2 +- 2022-02/spring-27/oauth/pom.xml | 82 +++++++++++++++++++ .../ru/otus/spring/sso/GithubApplication.java | 13 +++ .../oauth/src/main/resources/application.yml | 8 ++ .../src/main/resources/templates/index.html | 18 ++++ 6 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 2022-02/spring-27/oauth/pom.xml create mode 100644 2022-02/spring-27/oauth/src/main/java/ru/otus/spring/sso/GithubApplication.java create mode 100644 2022-02/spring-27/oauth/src/main/resources/application.yml create mode 100644 2022-02/spring-27/oauth/src/main/resources/templates/index.html diff --git a/2022-02/spring-27/ACL/pom.xml b/2022-02/spring-27/ACL/pom.xml index 2bfc4e24..7530872b 100644 --- a/2022-02/spring-27/ACL/pom.xml +++ b/2022-02/spring-27/ACL/pom.xml @@ -5,7 +5,7 @@ 4.0.0 ru.otus - spring-framework-25-acl + spring-framework-27-acl 1.0-SNAPSHOT diff --git a/2022-02/spring-27/WebFlux/pom.xml b/2022-02/spring-27/WebFlux/pom.xml index 62ea62b6..901b7254 100644 --- a/2022-02/spring-27/WebFlux/pom.xml +++ b/2022-02/spring-27/WebFlux/pom.xml @@ -5,7 +5,7 @@ 4.0.0 ru.otus - spring-framework-25-webflux + spring-framework-27-webflux 1.0-SNAPSHOT diff --git a/2022-02/spring-27/oauth/pom.xml b/2022-02/spring-27/oauth/pom.xml new file mode 100644 index 00000000..92b999fd --- /dev/null +++ b/2022-02/spring-27/oauth/pom.xml @@ -0,0 +1,82 @@ + + + 4.0.0 + + ru.otus + spring-framework-27-oauth + 1.0-SNAPSHOT + + + org.springframework.boot + spring-boot-starter-parent + 2.6.7 + + + + 2.6.11 + + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-oauth2-client + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + com.h2database + h2 + + + + + org.springdoc + springdoc-openapi-ui + 1.6.9 + + + + org.webjars + jquery + 3.4.1 + + + org.webjars + bootstrap + 4.3.1 + + + org.webjars + webjars-locator-core + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + diff --git a/2022-02/spring-27/oauth/src/main/java/ru/otus/spring/sso/GithubApplication.java b/2022-02/spring-27/oauth/src/main/java/ru/otus/spring/sso/GithubApplication.java new file mode 100644 index 00000000..7a69b021 --- /dev/null +++ b/2022-02/spring-27/oauth/src/main/java/ru/otus/spring/sso/GithubApplication.java @@ -0,0 +1,13 @@ +package ru.otus.spring.sso; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class GithubApplication { + + public static void main(String[] args) { + SpringApplication.run( GithubApplication.class, args); + } + +} \ No newline at end of file diff --git a/2022-02/spring-27/oauth/src/main/resources/application.yml b/2022-02/spring-27/oauth/src/main/resources/application.yml new file mode 100644 index 00000000..5d4d09d4 --- /dev/null +++ b/2022-02/spring-27/oauth/src/main/resources/application.yml @@ -0,0 +1,8 @@ +spring: + security: + oauth2: + client: + registration: + github: + clientId: fdec09b924be7f214eaa + clientSecret: 5436beb72dc2ec7f2320afcab5185c1ea03d484b \ No newline at end of file diff --git a/2022-02/spring-27/oauth/src/main/resources/templates/index.html b/2022-02/spring-27/oauth/src/main/resources/templates/index.html new file mode 100644 index 00000000..09dae5ba --- /dev/null +++ b/2022-02/spring-27/oauth/src/main/resources/templates/index.html @@ -0,0 +1,18 @@ + + + + + + Demo + + + + + + + + +

Demo

+
+ + \ No newline at end of file