SlideShare a Scribd company logo
1 of 14
ⓒSaebyeol Yu. Saebyeol’s PowerPoint
강임남
Login
Session & JWT
ⓒSaebyeol Yu. Saebyeol’s PowerPoint
목차
ⓒSaebyeol Yu. Saebyeol’s PowerPoint
1 Login
2 Cookie
3 Session
4 JWT
5 정리
ⓒSaebyeol Yu. Saebyeol’s PowerPoint
1
Login
ⓒSaebyeol Yu. Saebyeol’s PowerPoint
Part 1 Login
Login
접근 허가 증명을 얻기 위해 사용자 인증으로
개인이 컴퓨터 시스템에 접근하는 작업
> 사용자가 누구인지 인증하는 것
인증하기
⇒ 인증 유지하기 (browser)
⇒ 안전하게 인증하기 (server)
⇒ 효율적으로 인증하기 (token)
⇒ 다른 채널을 통해 인증하기 (OAuth)
ⓒSaebyeol Yu. Saebyeol’s PowerPoint
2
Cookie
ⓒSaebyeol Yu. Saebyeol’s PowerPoint
Part 2 Cookie
Cookie
서버가 설정한 정보를 클라이언트에 저장시킴
httpOnly: 서버에서만 접근 가능
secure: https protocol 로만 통신 가능
(아쉬운 점) httpOnly, secure 속성 실습
(궁금했던 점) localStorage ≠ cookie
ⓒSaebyeol Yu. Saebyeol’s PowerPoint
3
Session
ⓒSaebyeol Yu. Saebyeol’s PowerPoint
Part 3 Session
Session
인증된 사용자 정보를 Session ID 와 맵핑하여 서버에 저장
클라이언트에게 문자열(식별자)로 이루어진 ID를
응답 Header에 넣어 전송
네트워크 부하 상대적으로 적음
클라이언트 브라우저의 호환 문제 없음
서버의 다중화에 따른 세션 동기화 이슈 (Session 저장소)
사용자 증가 등으로 서버의 저장량이 커지면 서버에 부담 커짐
ⓒSaebyeol Yu. Saebyeol’s PowerPoint
Part 3 Session
Session
(궁금했던 점) session 언제 만들어질까? 무조건 생성이 아니다?!
(아쉬운 점) Tomcat session, HttpSession, Spring Session,
IdP (keycloak) session 이 같은 session 을 사용하는지 확인
(같이 해봤으면) createSessionId tracking 해보기
(같이 해봤으면) Redis vs Mysql 누가 더 빠를까?
ⓒSaebyeol Yu. Saebyeol’s PowerPoint
4
JWT
ⓒSaebyeol Yu. Saebyeol’s PowerPoint
Part 4 JWT
Token
클라이언트 ↔ 서버
(화살표인 통신 부분)요청과 응답에 사용자의 상태 정보를 담자!
토큰을 활용한 인증 방식
Sessionless
JWT: 정보를 Base64 암호화 시킨 JSON Web Token
Header, Payload(내용), Signature(서명) 구조
위변조 방지 위한 서버 개인키를 통한 저자 서명이 포함되어 있음
Base64 디코딩으로 쉽게 정보를 알아 낼 수 있어 민감 정보는 담지 않아야 함
ⓒSaebyeol Yu. Saebyeol’s PowerPoint
Part 4 JWT
JWT
(아쉬운점) 내가 구현해서 직접 경험하지 않음
(같이 해봤으면) jwt, xss, csrf
(좀 더 알아봐야 할 부분) refresh token <> sliding session
서로 상호 보완적인 개념
ⓒSaebyeol Yu. Saebyeol’s PowerPoint
5
정리
ⓒSaebyeol Yu. Saebyeol’s PowerPoint
Part 5 정리
결국엔 보안
그 외 키워드: 인증서버, OIDC, IdP(keycloak)

More Related Content

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 

Featured (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

login_cookie_session_jwt.pptx

  • 1. ⓒSaebyeol Yu. Saebyeol’s PowerPoint 강임남 Login Session & JWT
  • 2. ⓒSaebyeol Yu. Saebyeol’s PowerPoint 목차 ⓒSaebyeol Yu. Saebyeol’s PowerPoint 1 Login 2 Cookie 3 Session 4 JWT 5 정리
  • 3. ⓒSaebyeol Yu. Saebyeol’s PowerPoint 1 Login
  • 4. ⓒSaebyeol Yu. Saebyeol’s PowerPoint Part 1 Login Login 접근 허가 증명을 얻기 위해 사용자 인증으로 개인이 컴퓨터 시스템에 접근하는 작업 > 사용자가 누구인지 인증하는 것 인증하기 ⇒ 인증 유지하기 (browser) ⇒ 안전하게 인증하기 (server) ⇒ 효율적으로 인증하기 (token) ⇒ 다른 채널을 통해 인증하기 (OAuth)
  • 5. ⓒSaebyeol Yu. Saebyeol’s PowerPoint 2 Cookie
  • 6. ⓒSaebyeol Yu. Saebyeol’s PowerPoint Part 2 Cookie Cookie 서버가 설정한 정보를 클라이언트에 저장시킴 httpOnly: 서버에서만 접근 가능 secure: https protocol 로만 통신 가능 (아쉬운 점) httpOnly, secure 속성 실습 (궁금했던 점) localStorage ≠ cookie
  • 7. ⓒSaebyeol Yu. Saebyeol’s PowerPoint 3 Session
  • 8. ⓒSaebyeol Yu. Saebyeol’s PowerPoint Part 3 Session Session 인증된 사용자 정보를 Session ID 와 맵핑하여 서버에 저장 클라이언트에게 문자열(식별자)로 이루어진 ID를 응답 Header에 넣어 전송 네트워크 부하 상대적으로 적음 클라이언트 브라우저의 호환 문제 없음 서버의 다중화에 따른 세션 동기화 이슈 (Session 저장소) 사용자 증가 등으로 서버의 저장량이 커지면 서버에 부담 커짐
  • 9. ⓒSaebyeol Yu. Saebyeol’s PowerPoint Part 3 Session Session (궁금했던 점) session 언제 만들어질까? 무조건 생성이 아니다?! (아쉬운 점) Tomcat session, HttpSession, Spring Session, IdP (keycloak) session 이 같은 session 을 사용하는지 확인 (같이 해봤으면) createSessionId tracking 해보기 (같이 해봤으면) Redis vs Mysql 누가 더 빠를까?
  • 10. ⓒSaebyeol Yu. Saebyeol’s PowerPoint 4 JWT
  • 11. ⓒSaebyeol Yu. Saebyeol’s PowerPoint Part 4 JWT Token 클라이언트 ↔ 서버 (화살표인 통신 부분)요청과 응답에 사용자의 상태 정보를 담자! 토큰을 활용한 인증 방식 Sessionless JWT: 정보를 Base64 암호화 시킨 JSON Web Token Header, Payload(내용), Signature(서명) 구조 위변조 방지 위한 서버 개인키를 통한 저자 서명이 포함되어 있음 Base64 디코딩으로 쉽게 정보를 알아 낼 수 있어 민감 정보는 담지 않아야 함
  • 12. ⓒSaebyeol Yu. Saebyeol’s PowerPoint Part 4 JWT JWT (아쉬운점) 내가 구현해서 직접 경험하지 않음 (같이 해봤으면) jwt, xss, csrf (좀 더 알아봐야 할 부분) refresh token <> sliding session 서로 상호 보완적인 개념
  • 13. ⓒSaebyeol Yu. Saebyeol’s PowerPoint 5 정리
  • 14. ⓒSaebyeol Yu. Saebyeol’s PowerPoint Part 5 정리 결국엔 보안 그 외 키워드: 인증서버, OIDC, IdP(keycloak)

Editor's Notes

  1. httpOnly, secure 속성은 서버→클라이언트로 던져주며, 클라이언트→서버는 값을 주지 않음(tomcat 8.5 이상) https://pygmalion0220.tistory.com/entry/HTTP-Cookie-기본-개념  localstorage ≠ cookie (localstorage: browser, HTML5 specification, 5MB per domain, 용도는 네트워크 사용 대역폭을 줄이려고, 만료없고, 사용자가 지우지 않는한 영구적 cookie: 서버가 클라이언트에게 저장하라고 시킨 데이터 (session, user, server에 접근할 때 필요한 정보들,,), 4KB per domain, 만료기한 있음 )
  2. Sessionless 에 대한 필요성 대두
  3. https://stackoverflow.com/questions/54115127/difference-between-spring-httpsession-and-tomcat-session https://stackoverflow.com/questions/24989788/is-redis-faster-than-mysql https://dkomanov.medium.com/mysql-as-redis-vs-redis-74b788af9c6f
  4. Sessionless 에 대한 필요성 대두 Refresh token 관리에 대한 고찰 필요
  5. https://cjw-awdsd.tistory.com/48
  6. Gateway https://www.samsungsds.com/kr/insights/oidc.html