menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

Validation...
source image

Dev

1M

read

103

img
dot

Image Credit: Dev

Validation, Authentication and Authorization

  • This article discusses validation, authentication, and authorization in building a CRUD API with express.
  • The importance of validating user data and the potential security risks of not doing so are highlighted.
  • Authentication involves verifying a user's identity, usually by checking their credentials.
  • Authorization involves determining what actions a user can and cannot perform on a platform, often determined by their level of access or permissions.
  • The author provides validation rules for name, amount, and date, as well as functions to implement them.
  • For authentication, the article shows how to create and log in users with email and password credentials, and generate authorization tokens.
  • To protect endpoints, the article demonstrates how to decode and verify a user's auth token and filter data based on their userId.
  • The article concludes by cautioning not to save raw passwords and mentions further topics to explore.

Read Full Article

like

6 Likes

For uninterrupted reading, download the app