spring security 인증 처리
This commit is contained in:
@@ -39,6 +39,11 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
<version>2.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-rest-hal-browser</artifactId>
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.example.restfulwebservice.config;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
|
||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
||||
|
||||
@Configuration
|
||||
public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
@Autowired
|
||||
public void ConfigureGlobal(AuthenticationManagerBuilder auth)
|
||||
throws Exception{
|
||||
auth.inMemoryAuthentication()
|
||||
.withUser("kim")
|
||||
.password("{noop}test1234")
|
||||
.roles("USER");
|
||||
}
|
||||
}
|
||||
@@ -8,9 +8,13 @@ logging:
|
||||
spring:
|
||||
messages:
|
||||
basename: messages
|
||||
security:
|
||||
user:
|
||||
name: username
|
||||
password: passw0rd
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: "*"
|
||||
include: "*"
|
||||
|
||||
Reference in New Issue
Block a user