@@ -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> |
@@ -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> |
@@ -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 |