User1724605321 posted
Hi sdyson31,
Token Based Authentication is more secure, more reliable and makes your system loosely coupled. It will be a better choice to create REST API using token-based authentication, if your API reached to broad range of devices like mobiles, tablets and
traditional desktops.
Tokens are uniquely generated per application and site. If someone steals a token, they have not stolen your password, and that token is only good for that session only.
In token-based authentication, you pass your credentials [user name and password], which go to authentication server. Server verifies your credentials and if it is a valid user then it will return a signed token(can access your database) to client
system, which has expiration time. Client can store this token to locally using any mechanism like local storage, session storage etc and if client makes any other call to server for data then it does not need to pass its credentials every time. Client can
directly pass token to server, which will be validated by server and if token is valid then you will able to access your data.
https://blogs.perficient.com/2017/06/11/token-based-authentication-in-web-api-2-via-owin/
Best Regards,
Nan Yu