Преглед на файлове

first commit

tags/V2.2.0
chenjiandong преди 2 години
родител
ревизия
5c2413a87d
променени са 32 файла, в които са добавени 54 реда и са изтрити 17 реда
  1. +15
    -3
      pom.xml
  2. +28
    -6
      tuoheng_oidc_server/pom.xml
  3. +0
    -0
      tuoheng_oidc_server/src/main/java/com/tuoheng/SpringAuthorizationServerApplication.java
  4. +0
    -0
      tuoheng_oidc_server/src/main/java/com/tuoheng/config/AuthorizationServerConfig.java
  5. +0
    -0
      tuoheng_oidc_server/src/main/java/com/tuoheng/config/IdTokenCustomizerConfig.java
  6. +0
    -0
      tuoheng_oidc_server/src/main/java/com/tuoheng/config/JWKSourceConfig.java
  7. +0
    -0
      tuoheng_oidc_server/src/main/java/com/tuoheng/config/MyCorsFilter.java
  8. +11
    -8
      tuoheng_oidc_server/src/main/java/com/tuoheng/config/SecurityConfig.java
  9. +0
    -0
      tuoheng_oidc_server/src/main/java/com/tuoheng/controller/HealthController.java
  10. +0
    -0
      tuoheng_oidc_server/src/main/java/com/tuoheng/controller/Oauth2Controller.java
  11. +0
    -0
      tuoheng_oidc_server/src/main/java/com/tuoheng/controller/UserController.java
  12. +0
    -0
      tuoheng_oidc_server/src/main/java/com/tuoheng/mapper/AuthoritiesMapper.java
  13. +0
    -0
      tuoheng_oidc_server/src/main/java/com/tuoheng/mapper/UserMapper.java
  14. +0
    -0
      tuoheng_oidc_server/src/main/java/com/tuoheng/model/dto/UserBaseInfoDto.java
  15. +0
    -0
      tuoheng_oidc_server/src/main/java/com/tuoheng/model/param/CreateUserDto.java
  16. +0
    -0
      tuoheng_oidc_server/src/main/java/com/tuoheng/model/po/AuthoritiesPo.java
  17. +0
    -0
      tuoheng_oidc_server/src/main/java/com/tuoheng/model/po/UserPo.java
  18. +0
    -0
      tuoheng_oidc_server/src/main/java/com/tuoheng/service/OidcUserInfoService.java
  19. +0
    -0
      tuoheng_oidc_server/src/main/java/com/tuoheng/service/UserSevice.java
  20. +0
    -0
      tuoheng_oidc_server/src/main/java/com/tuoheng/service/impl/OidcUserInfoServiceImpl.java
  21. +0
    -0
      tuoheng_oidc_server/src/main/java/com/tuoheng/service/impl/UserServiceImpl.java
  22. +0
    -0
      tuoheng_oidc_server/src/main/java/com/tuoheng/until/CryptoUtil.java
  23. +0
    -0
      tuoheng_oidc_server/src/main/java/com/tuoheng/until/JsonResult.java
  24. +0
    -0
      tuoheng_oidc_server/src/main/java/com/tuoheng/until/RegisteredClientUtil.java
  25. +0
    -0
      tuoheng_oidc_server/src/main/resources/application-dev.yml
  26. +0
    -0
      tuoheng_oidc_server/src/main/resources/application-local.yml
  27. +0
    -0
      tuoheng_oidc_server/src/main/resources/application-prod.yml
  28. +0
    -0
      tuoheng_oidc_server/src/main/resources/application-test.yml
  29. +0
    -0
      tuoheng_oidc_server/src/main/resources/application.yml
  30. +0
    -0
      tuoheng_oidc_server/src/main/resources/mapper/AuthoritiesMapper.xml
  31. +0
    -0
      tuoheng_oidc_server/src/main/resources/mapper/UserMapper.xml
  32. +0
    -0
      tuoheng_oidc_server/src/main/resources/templates/login.html

+ 15
- 3
pom.xml Целия файл

@@ -8,13 +8,17 @@
<version>2.7.3</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<modules>
<module>tuoheng_oidc_server</module>
</modules>
<groupId>com.tuoheng</groupId>
<artifactId>tuoheng_oidc</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0</version>
<name>tuoheng_oidc</name>
<description>tuoheng_oidc</description>
<properties>
<java.version>1.8</java.version>
<tuoheng.version>1.0.0</tuoheng.version>
</properties>
<dependencies>
<dependency>
@@ -27,13 +31,21 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.tuoheng</groupId>
<artifactId>tuoheng_oidc_server</artifactId>
<version>${tuoheng.version}</version>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
</plugin>
</plugins>
</build>

Spring_Authorization_Server/pom.xml → tuoheng_oidc_server/pom.xml Целия файл

@@ -3,10 +3,9 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.3</version>
<relativePath/> <!-- lookup parent from repository -->
<artifactId>tuoheng_oidc</artifactId>
<groupId>com.tuoheng</groupId>
<version>1.0.0</version>
</parent>
<groupId>com.tuoheng</groupId>
<artifactId>tuoheng_oidc_server</artifactId>
@@ -127,7 +126,9 @@
</profile>
</profiles>

<!-- 环境变量构建 -->
<build>
<finalName>tuoheng_dsp_system</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
@@ -153,10 +154,31 @@
</includes>
</resource>
</resources>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.1.11.RELEASE</version>
<configuration>
<finalName>${project.build.finalName}</finalName>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
</plugin>
</plugins>
</build>

Spring_Authorization_Server/src/main/java/com/tuoheng/SpringAuthorizationServerApplication.java → tuoheng_oidc_server/src/main/java/com/tuoheng/SpringAuthorizationServerApplication.java Целия файл


Spring_Authorization_Server/src/main/java/com/tuoheng/config/AuthorizationServerConfig.java → tuoheng_oidc_server/src/main/java/com/tuoheng/config/AuthorizationServerConfig.java Целия файл


Spring_Authorization_Server/src/main/java/com/tuoheng/config/IdTokenCustomizerConfig.java → tuoheng_oidc_server/src/main/java/com/tuoheng/config/IdTokenCustomizerConfig.java Целия файл


Spring_Authorization_Server/src/main/java/com/tuoheng/config/JWKSourceConfig.java → tuoheng_oidc_server/src/main/java/com/tuoheng/config/JWKSourceConfig.java Целия файл


Spring_Authorization_Server/src/main/java/com/tuoheng/config/MyCorsFilter.java → tuoheng_oidc_server/src/main/java/com/tuoheng/config/MyCorsFilter.java Целия файл


Spring_Authorization_Server/src/main/java/com/tuoheng/config/SecurityConfig.java → tuoheng_oidc_server/src/main/java/com/tuoheng/config/SecurityConfig.java Целия файл

@@ -15,12 +15,15 @@ import org.springframework.security.config.annotation.web.configuration.EnableWe
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;
import org.springframework.security.config.annotation.web.configurers.oauth2.server.authorization.OAuth2AuthorizationServerConfigurer;
import org.springframework.security.config.annotation.web.configurers.oauth2.server.resource.OAuth2ResourceServerConfigurer;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.oauth2.core.oidc.OidcUserInfo;
import org.springframework.security.oauth2.server.authorization.config.ProviderSettings;
import org.springframework.security.oauth2.server.authorization.oidc.authentication.OidcUserInfoAuthenticationContext;
import org.springframework.security.oauth2.server.authorization.oidc.authentication.OidcUserInfoAuthenticationToken;
import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken;
import org.springframework.security.provisioning.InMemoryUserDetailsManager;
import org.springframework.security.provisioning.JdbcUserDetailsManager;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint;
@@ -101,14 +104,14 @@ public class SecurityConfig {

@Bean
public UserDetailsService userDetailsService() {
// UserDetails userDetails = User.withDefaultPasswordEncoder()
// .username("admin")
// .password("123456")
// .roles("USER")
// .build();
//
// return new InMemoryUserDetailsManager(userDetails);
return new JdbcUserDetailsManager(dataSource);
UserDetails userDetails = User.withDefaultPasswordEncoder()
.username("admin")
.password("123456")
.roles("ADMIN")
.build();
return new InMemoryUserDetailsManager(userDetails);
//return new JdbcUserDetailsManager(dataSource);
}

@Bean

Spring_Authorization_Server/src/main/java/com/tuoheng/controller/HealthController.java → tuoheng_oidc_server/src/main/java/com/tuoheng/controller/HealthController.java Целия файл


Spring_Authorization_Server/src/main/java/com/tuoheng/controller/Oauth2Controller.java → tuoheng_oidc_server/src/main/java/com/tuoheng/controller/Oauth2Controller.java Целия файл


Spring_Authorization_Server/src/main/java/com/tuoheng/controller/UserController.java → tuoheng_oidc_server/src/main/java/com/tuoheng/controller/UserController.java Целия файл


Spring_Authorization_Server/src/main/java/com/tuoheng/mapper/AuthoritiesMapper.java → tuoheng_oidc_server/src/main/java/com/tuoheng/mapper/AuthoritiesMapper.java Целия файл


Spring_Authorization_Server/src/main/java/com/tuoheng/mapper/UserMapper.java → tuoheng_oidc_server/src/main/java/com/tuoheng/mapper/UserMapper.java Целия файл


Spring_Authorization_Server/src/main/java/com/tuoheng/model/dto/UserBaseInfoDto.java → tuoheng_oidc_server/src/main/java/com/tuoheng/model/dto/UserBaseInfoDto.java Целия файл


Spring_Authorization_Server/src/main/java/com/tuoheng/model/param/CreateUserDto.java → tuoheng_oidc_server/src/main/java/com/tuoheng/model/param/CreateUserDto.java Целия файл


Spring_Authorization_Server/src/main/java/com/tuoheng/model/po/AuthoritiesPo.java → tuoheng_oidc_server/src/main/java/com/tuoheng/model/po/AuthoritiesPo.java Целия файл


Spring_Authorization_Server/src/main/java/com/tuoheng/model/po/UserPo.java → tuoheng_oidc_server/src/main/java/com/tuoheng/model/po/UserPo.java Целия файл


Spring_Authorization_Server/src/main/java/com/tuoheng/service/OidcUserInfoService.java → tuoheng_oidc_server/src/main/java/com/tuoheng/service/OidcUserInfoService.java Целия файл


Spring_Authorization_Server/src/main/java/com/tuoheng/service/UserSevice.java → tuoheng_oidc_server/src/main/java/com/tuoheng/service/UserSevice.java Целия файл


Spring_Authorization_Server/src/main/java/com/tuoheng/service/impl/OidcUserInfoServiceImpl.java → tuoheng_oidc_server/src/main/java/com/tuoheng/service/impl/OidcUserInfoServiceImpl.java Целия файл


Spring_Authorization_Server/src/main/java/com/tuoheng/service/impl/UserServiceImpl.java → tuoheng_oidc_server/src/main/java/com/tuoheng/service/impl/UserServiceImpl.java Целия файл


Spring_Authorization_Server/src/main/java/com/tuoheng/until/CryptoUtil.java → tuoheng_oidc_server/src/main/java/com/tuoheng/until/CryptoUtil.java Целия файл


Spring_Authorization_Server/src/main/java/com/tuoheng/until/JsonResult.java → tuoheng_oidc_server/src/main/java/com/tuoheng/until/JsonResult.java Целия файл


Spring_Authorization_Server/src/main/java/com/tuoheng/until/RegisteredClientUtil.java → tuoheng_oidc_server/src/main/java/com/tuoheng/until/RegisteredClientUtil.java Целия файл


Spring_Authorization_Server/src/main/resources/application-dev.yml → tuoheng_oidc_server/src/main/resources/application-dev.yml Целия файл


Spring_Authorization_Server/src/main/resources/application-local.yml → tuoheng_oidc_server/src/main/resources/application-local.yml Целия файл


Spring_Authorization_Server/src/main/resources/application-prod.yml → tuoheng_oidc_server/src/main/resources/application-prod.yml Целия файл


Spring_Authorization_Server/src/main/resources/application-test.yml → tuoheng_oidc_server/src/main/resources/application-test.yml Целия файл


Spring_Authorization_Server/src/main/resources/application.yml → tuoheng_oidc_server/src/main/resources/application.yml Целия файл


Spring_Authorization_Server/src/main/resources/mapper/AuthoritiesMapper.xml → tuoheng_oidc_server/src/main/resources/mapper/AuthoritiesMapper.xml Целия файл


Spring_Authorization_Server/src/main/resources/mapper/UserMapper.xml → tuoheng_oidc_server/src/main/resources/mapper/UserMapper.xml Целия файл


Spring_Authorization_Server/src/main/resources/templates/login.html → tuoheng_oidc_server/src/main/resources/templates/login.html Целия файл


Loading…
Отказ
Запис