sef-global / scholarx-backend

This is the backend of the ScholarX
MIT License
10 stars 37 forks source link

Implementation of HttpOnly cookies #60

Closed anjula-sack closed 1 year ago

anjula-sack commented 1 year ago

Description: To elevate the security and user experience of our authentication system, we're introducing a critical enhancement: the implementation of HttpOnly cookies. By leveraging this method, we'll enhance protection against cross-site scripting (XSS) attacks and bolster the overall security of our application's user sessions. We'll achieve this using the trusted Passport.js framework and JWT (JSON Web Tokens), ensuring that user sessions remain safeguarded while maintaining a seamless user journey.

Tasks:

  1. Incorporate the necessary dependencies for Passport.js and JWT within the project.
  2. Configure Passport.js to seamlessly integrate HttpOnly cookies for enhanced session management.
  3. Develop a user registration endpoint, adhering to rigorous security standards for new account creation.
  4. Create a login endpoint, allowing users to access their accounts securely and initiating the use of HttpOnly cookies.
  5. Implement a protected endpoint, ensuring access is restricted to users with valid session cookies.
  6. Set up middleware to authenticate incoming requests using Passport.js and validate session cookies.
  7. Establish a streamlined session logout feature, effectively invalidating session cookies for a secure user logout experience.

Acceptance Criteria:

Additional Information:

Related Dependencies or References: