spring security 인증 처리

This commit is contained in:
haerong22
2020-11-28 17:40:00 +09:00
parent 819e224316
commit 4b4193017f
3 changed files with 28 additions and 1 deletions

View File

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

View File

@@ -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");
}
}

View File

@@ -8,9 +8,13 @@ logging:
spring:
messages:
basename: messages
security:
user:
name: username
password: passw0rd
management:
endpoints:
web:
exposure:
include: "*"
include: "*"