개발일기

학원 수업 63일차 221118

hhana 2023. 4. 27. 13:54
  • 9-10

OAuth2 Client
: 소설로그인을 위한 security 설정

authentication 인증

 

 

  • 10-11

csrf
https://docs.spring.io/spring-security/reference/5.7.3/servlet/exploits/csrf.html#servlet-csrf-include-form-attr
Example 6. CSRF Token in Form with Request Attribute

<input type="hidden"
name="${_csrf.parameterName}"
value="${_csrf.token}"/>

 

 

  • 11-12

(/springWebSecurity04/src/main/java/com/green/nowon/security/CustomUserDetailsService.java)
In-Memory Authentication
https://docs.spring.io/spring-security/reference/5.7.3/servlet/authentication/passwords/in-memory.html

UserDetailsService
https://docs.spring.io/spring-security/reference/5.7.3/servlet/authentication/passwords/user-details-service.html

@Bean
CustomUserDetailsService customUserDetailsService() {
	return new CustomUserDetailsService();
}


@Bean @Component ? 둘중하나?

Entity 만드는 중

ENUM?

@DynamicUpdate?
@DynamicInsert?

@ElementCollection?

 

 

  • 12-1

Entity 만드는 중
(/springWebSecurity04/src/main/java/com/green/nowon/domain/entity/MemberEntity.java)

 

 

  • 2-3

@Qualifier?
(/springWebSecurity04/src/main/java/com/green/nowon/controller/SignController.java)
동일한 데이터타입의 빈이 2개 이상 있을 때 어떤걸 매핑시킬까요?를 지정
https://n1tjrgns.tistory.com/163

https://www.thymeleaf.org/doc/tutorials/3.1/usingthymeleaf.html#contexts
There are some specialized expressions that we will be able to use to obtain the request parameters and the request, session and application attributes from the WebContext in our templates.
For example:
${x} will return a variable x stored into the Thymeleaf context or as an exchange attribute (A “request attribute” in Servlet jargon).
${param.x} will return a request parameter called x (which might be multivalued).
${session.x} will return a session attribute called x.
${application.x} will return an application attribute called x (a “servlet context attribute” in Servlet jargon).

AOP?

 

 

  • 3-4

로그인 메시지 작업

.orElseThrow()
NullPointerException을 예방

 

  • 4-5

로그인 메시지 작업
로그아웃

 

 

  • 5-6

/springWebSecurity04/Java Resources/Libraries/Project and External Dependencies / spring-security-core-5.7.4.jar / messages_ko_KR.properties
/org/springframework/security/messages_ko_KR.properties

AbstractUserDetailsAuthenticationProvider.badCredentials = \uc790\uaca9 \uc99d\uba85\uc5d0 \uc2e4\ud328\ud558\uc600\uc2b5\ub2c8\ub2e4.