[항해99] 59일차 passport인증 , 로그인
항해 99
59일 차:
어저께까지만 해도 , typescript - OOP - MVC 패턴으로 구현을 했으니 기본적인 이해는 했을 거라 생각했는데,
passport를 쓸려고 보니깐 뭘 어떻게 해야 하는지 어디서부터 시작해야 하는지조차도 모르겠다.
게다가 passport - typescript를 이용하는 tutorial이나 자료가 생각보다 찾을 수가 없었다.
어떻게 해야 하는지 머리가 아프다.
이렇게 공부를 하는 게 맞는 건지 또 모르겠다.
공식문서를 보고 따라 하자니 node js - passport기준이고, 인터넷에서 찾아서 따라 해 보자니 , typescript - passport기준이고
passport를 typecsript 를이용해서 어떻게 MVC패턴으로 변경하는지 모르겠다.
모르겠다 모르겠따 모르겟다 배고프다 모르겟다 모르겟다 배고프다 집에 가고 싶다 배고프다 모르겠다.
일단 이걸 봤다.
https://www.zerocho.com/category/NodeJS/post/57b7101ecfbef617003bf457
응 당연히 몰라 뭔 소린지.
official documenation을 봤다 음...
http://www.passportjs.org/docs/username-password/
정신 차리고, 최대한 내가 할 수 있는 것을 찾아봤다.
https://www.youtube.com/watch?v=Jo8L8pru6ZI
Authentication 101 :
- Authentication vs Authorization
authentication : confrimes that users are who they say they are;
imagine you go to hotel and check in and get the hotel room key card
authorization : give those users permission to access a resoucres
imagine using the key card and go in to your own hotel room or gym ... etc
-Stateful vs stateless
stateful: get the key from the recpetion , but the key is connect to reception by rope
so the reception can have control of the key
Pros : easy to revoke / control of the key
Cons : incraese server load , hard to scale , hard to intergrate with 3rd party
Session;
stateless: like the hotel room card, the reception wont give a shit.
Pros : low server load, easy to scale , easy to integrate with 3rd pary
Cons: cant revoke , less control , more complexity
HTTP Authentication:
Bearer token authentication
{"Authorization" : "Bearer TOKEN"}
JWT is not encrpyted , its just encoded. everyone can see.
consisted with 3parts , header ,payload , footer
Bcrypt :
initial data : hello. salt : hi
hello hi => hash = > 392d3482js. (something high security)
salt : something randome data with original data. to be hashed together to enhence the security
hash :
/auth/login
1. find email => if it exist => check password => login (JWT token ) ,
'IT > Bootcamp 항해99' 카테고리의 다른 글
[항해99] 62일차 & 63일차 패스포트 지긋지긋해요 (4) | 2021.08.09 |
---|---|
[항해99] 61일차 passport 꼭 끝내고말꺼야는 개뿔 프리즈마했어 (4) | 2021.08.07 |
[ 항해99] 58일차 일기장 (2) | 2021.08.03 |
[항해99] 57일차 타입스크립트 , 객체지향 프로그래밍 , MVC 패턴 (0) | 2021.08.03 |
[항해99] 55일차 56일차 typescript , MVC (0) | 2021.08.02 |