Spring boot Security Authentication 데이터 내용
2024. 8. 15. 20:02ㆍJava/Spring Boot Security
입력
name: AA
password: DDD
소스
@Slf4j
public class CustomAuthenticationProvider extends DaoAuthenticationProvider {
public Authentication authenticate(Authentication auth) throws AuthenticationException {
log.debug(auth.getPrincipal().toString());
log.debug(auth.toString());
log.debug(auth.getName());
log.debug(auth.getDetails().toString());
log.debug(auth.getCredentials().toString());
생략
}
}
결과
AA
UsernamePasswordAuthenticationToken [Principal=AA, Credentials=[PROTECTED], Authenticated=false, Details=CustomWebAuthenticationDetails [RemoteIpAddress=0:0:0:0:0:0:0:1, SessionId=304F976A0D0B9C983187CC049B190219], Granted Authorities=[]]
AA
CustomWebAuthenticationDetails [RemoteIpAddress=0:0:0:0:0:0:0:1, SessionId=304F976A0D0B9C983187CC049B190219]
DDD
결론
auth.getPrincipal(): name
auth.getCredentials(): password
'Java > Spring Boot Security' 카테고리의 다른 글
Spring boot Security 비밀번호 비교 (0) | 2024.08.15 |
---|---|
Spring boot Security 에러 메세지 처리 (0) | 2024.08.15 |
Spring boot Security 객체 참조 (0) | 2024.08.13 |
Spring boot Security blocked:mixed-content 에러 (0) | 2024.08.11 |
Spring boot Security 302 에러 (0) | 2024.08.11 |