목록Spring (5)
우당탕탕 개발일지
Swagger는 Spring-Fox, Spring-Doc 2가지 라이브러리가 존재한다.Spring-Fox는 오래전에 나온 라이브러리이기 때문에, Spring-Doc를 사용할 예정이다. 1. 의존성 추가dependencies { . . . //Security implementation 'org.springframework.boot:spring-boot-starter-security' testImplementation 'org.springframework.security:spring-security-test' // swagger implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.4' } 2. SwaggerConfig..
프로젝트를 진행하면서 가상 API 서버가 필요하여 해당 서버에 JWT 서비스를 적용하게 되었다. GitHub - jwtk/jjwt: Java JWT: JSON Web Token for Java and AndroidJava JWT: JSON Web Token for Java and Android. Contribute to jwtk/jjwt development by creating an account on GitHub.github.com dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-web..
선행조건1. build.gradle에 필요한 의존성 추가dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-security' compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' //MySQL runtimeOnly 'com.mysql:mysql-connector-j' //JWT im..
1단계. 로그인 환경 구성유저 아이디로 로그인을 구현할 것이기 때문에 사용자 이름을 선택해 주었다. 2단계. 보안 요구 사항 구성MFA 방법으로 SMS메시지 혹은 인증 앱을 이용하는 방법이 있는데, SMS 메시지 방식은 Amazon SMS에서 비용이 별도 부과되어 사용하지 않기로 결정했다. 3단계. 가입 환경 구성cognito는 인증/인가 기능만 대체해주고, 실제 사용자 정보는 cognito_id로 다른 DB에 저장할 예정이기 때문에 default 값으로 설정한다. 4단계. 메시지 전송 구성 5단계. 앱 통합백엔드 서버에서 인증을 처리하기 때문에 기밀 클라이언트를 설정해주었고, access-token은 1시간, refresh-token은 1일로 설정해주었다. 클라이언트 보안키 표시를 활성화한 후, 클라이..
스프링 부트의 웹 애플리케이션은 'MVC 아키텍처'라고 하는 개념을 기반으로 설계돼 있다. 애플리케이션을 Model, View, Controller라는 역할로 나누어 구축해가는 방식이다. Model(모델) - 애플리케이션에서 사용할 데이터를 관리한다. View(뷰) - 실제로 사용자가 보는 화면을 만든다. Controller(컨트롤러) - 전체 처리를 제어한다. Model 템플릿에서 사용할 데이터들을 일괄해서 관리한다. 데이터 관리가 주 목적이기에 뷰 관련 정보는 가지고 있지 않다. 따라서 Model을 반환값으로 사용할 수는 없다. @ModelAttribute 애노테이션은 컨트롤러 메서드의 매개변수에 사용하여 요청의 데이터를 객체로 바인딩하는 역할을 한다. 요청한 파라미..