121. What is authentication in the context of Node.js web applications?
Answer:The process of verifying the identity of a user or client
122. What is authorization in Node.js?
Answer:The process of granting or denying access to specific resources or actions based on the authenticated user's permissions
123. Which Node.js middleware is commonly used for implementing authentication and user sessions?
124. What is the primary role of the passport module in Node.js authentication?
Answer:To provide a middleware-based authentication framework for various strategies (e.g., local, OAuth)
125. What is a common strategy used for user authentication with the passport module in Node.js?
Answer:All of the above
126. What is a JSON Web Token (JWT) in the context of authentication in Node.js?
Answer:A compact, URL-safe means of representing claims to be transferred between two parties
127. What is the primary benefit of using JWT for authentication in Node.js?
Answer:It allows stateless authentication, where user information is encoded in the token itself.
128. What is a role-based access control (RBAsystem in the context of authorization in Node.js?
Answer:A system that assigns specific roles to users and grants permissions based on those roles
129. In Node.js authorization, what is the purpose of defining access control rules or policies?
Answer:To specify which users or roles can perform specific actions or access certain resources
130. What HTTP status code is typically returned when a user tries to access a resource for which they are not authorized in Node.js?
Node Js Interview Questions With Answers Node Js MCQ Node Js Multiple Choice Questions Node Js MCQ Questions And Answers