What are the differences between local Basic and Digest strategy in passportjs

前端 未结 2 594
走了就别回头了
走了就别回头了 2021-01-31 08:09

I understand the difference between Passport.js\' Basic and Digest authentication, but what is the difference between the local strategy and Basic or Digest? In all three, you e

2条回答
  •  一整个雨季
    2021-01-31 08:56

    If you a using the Passport Local strategy: - a session is established, so you don't have to send creds on each request; - username and password are provided in "username" and "password" headers by default;

    If you a using the Passport Basic/Digest strategies: - a session is not used, so you must provide the credentials at every API call; - username and password/hash are contained within "Authorization" header;

提交回复
热议问题