스프링

 

1) 스프링부트 2.7.0  사용

2) jwt 라이브러리 

	<dependency>
			<groupId>io.jsonwebtoken</groupId>
			<artifactId>jjwt-api</artifactId>
			<version>0.11.5</version>
		</dependency>

		<dependency>
			<groupId>io.jsonwebtoken</groupId>
			<artifactId>jjwt-impl</artifactId>
			<version>0.11.5</version>
			<scope>runtime</scope>
		</dependency>
		
		<dependency>
			<groupId>io.jsonwebtoken</groupId>
			<artifactId>jjwt-jackson</artifactId> 
			<version>0.11.5</version>
			<scope>runtime</scope>
		</dependency>

 

 

1 .Security 설정, Data 설정

2.JWT 코드, Security 설정 

3.DTO, Repository, 로그인 

4. #회원가입, 권한검증

 

소스 :

1) https://github.com/braverokmc79/jwt-tutorial-maven    (2.7.0)

2) https://github.com/SilverNine/spring-boot-jwt-tutorial   (2.5.3)

3)https://github.com/ParkJiwoon/practice-codes/tree/master/spring-security-jwt    ( 2.4.3)

 

 

 

https://bcp0109.tistory.com/301

Spring Security 와 JWT 겉핥기

 

 

 

 

 

 

1. 프로젝트  파일 리스트

 

 

 

2. 회원 가입

 

 

 

3. 로그인

 

 

 

4.POSTMAN 토큰 전역 변수로 사용 설정

*  포스트맨 토큰 유지방법  test  탭에 다음과 같이
var jsonData =JSON.parse(responseBody)
pm.globals.set("jwt_tutorial_token", jsonData.token);

 

 

 

5. 유저별 권한 테스트 및  POSTMAN  전역 변수 사용

 

 

 

 

참조 및 강의

Spring Boot JWT Tutorial

정은구 

http://silvernine.me

https://www.inflearn.com/course/%EC%8A%A4%ED%94%84%EB%A7%81%EB%B6%80%ED%8A%B8-jwt#reviews

 

 

 

 

 

about author

PHRASE

Level 60  라이트

벼슬하면서 사욕을 채우다가 벼슬을 잃으면 후회하게 된다. 부유했을 적에 비용을 절약하지 않으면 가난해졌을 때 후회한다. 기예를 젊었을 때 배우지 시기를 넘기고서 후회하게 된다. 일을 보고 배우지 않으면 필요하게 되었을 때 후회한다. 술취한 뒤에 함부로 말하면 깨어났을 때 후회한다. 몸이 성했을 때 휴식을 취하지 않으면 병들었을 때 후회한다. -구래공

댓글 ( 4)

댓글 남기기

작성