[항해99] 59일차 passport인증 , 로그인

IT/Bootcamp 항해99|2021. 8. 5. 02:52

항해 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

 

(NodeJS) Passport로 회원가입 및 로그인하기

안녕하세요. 이번 시간에는 Passport.js 패키지를 사용해 회원가입과 로그인을 구현하겠습니다! 이 강좌는 ReactJS 리덕스 강좌와도 이어집니다.  npm install passport passport-local express-session 일단 두 패

www.zerocho.com

응 당연히 몰라 뭔 소린지.

 

official documenation을 봤다  음...

 

http://www.passportjs.org/docs/username-password/

 

Documentation: Username & Password

Username & Password The most widely used way for websites to authenticate users is via a username and password. Support for this mechanism is provided by the passport-local module. Install $ npm install passport-local Configuration var passport = require('

www.passportjs.org

 

정신 차리고, 최대한 내가 할 수 있는 것을 찾아봤다.

 

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 ) , 

 

https://ithub.tistory.com/215

 

.pem파일 없이 AWS EC2 접속하는 방법

안녕하세요. 오늘은 AWS EC2를 사용할때 .pem파일을 사용하지 않고 접속하는 방법에 대해서 알아보겠습니다. .pem 파일은 잘 관리되어야 합니다. 분실하거나 타인이 취득할 경우 EC2에 접속을 못하게

ithub.tistory.com

 

 

반응형

댓글()