REST API2 Spring boot - blog application (REST API) : Securing REST APIs REST API 에서 스프링 시큐리티는 어떻게 적용이 될까? Dependency org.springframework.boot spring-boot-starter-security application.properties logging.level.org.springframework.security=DEBUG spring.security.user.name=kjh spring.security.user.password=password spring.security.user.roles=ADMIN 실행을 하면 시큐리티 자체 로그인 페이지로 넘어가게 되는데 application.properties 에서 user name, password 를 설정하여 시큐리티에 로그인 할 수 있다. Postman 에서 시큐리티 적용된 서.. 2022. 7. 20. Spring boot - blog application (REST API) : Comment Creating JPA "Comment" Entity Comment @Data @NoArgsConstructor @AllArgsConstructor @Entity @Table(name = "comments") public class Comment { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String body; private String email; private String name; @ManyToOne(fetch =FetchType.LAZY) @JoinColumn(name="post_id", nullable=false) private Post post; } @ManyToOne(fetch =Fetc.. 2022. 7. 3. 이전 1 다음