Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is token-based authentication?

I want to understand what token-based authentication means. I searched the internet but couldn't find anything understandable.

like image 687
csharpbaby Avatar asked Oct 20 '09 04:10

csharpbaby


People also ask

What is token based authentication in Web API?

What is Token Based Authentication in Web API? Token-based authentication is a process where the client application first sends a request to Authentication server with a valid credentials. The Authentication server sends an Access token to the client as a response.

How does a authentication token work?

All trusted devices (authentication tokens) contain data created by the server and that is used to prove the identity of a particular user. The purpose of a token is to generate an One-Time Password (OTP) which will then be validated by the server.

What is the difference between OAuth and token based authentication?

The difference is that API tokens incorporate the user account in the access token while OAuth apps perform authorization without a user account. When you make a choice of using an API token or an OAuth app to make an API call, you must consider the specific requirements of the API service involved in the interaction.

What are the different types of authentication tokens?

The most common types of tokens are key fobs and USB or wireless tokens. Hardware tokens can be divided into three categories. Contactless—a contactless token doesn't require you to enter an access code or connect to a device.


1 Answers

I think it's well explained here -- quoting just the key sentences of the long article:

The general concept behind a token-based authentication system is simple. Allow users to enter their username and password in order to obtain a token which allows them to fetch a specific resource - without using their username and password. Once their token has been obtained, the user can offer the token - which offers access to a specific resource for a time period - to the remote site.

In other words: add one level of indirection for authentication -- instead of having to authenticate with username and password for each protected resource, the user authenticates that way once (within a session of limited duration), obtains a time-limited token in return, and uses that token for further authentication during the session.

Advantages are many -- e.g., the user could pass the token, once they've obtained it, on to some other automated system which they're willing to trust for a limited time and a limited set of resources, but would not be willing to trust with their username and password (i.e., with every resource they're allowed to access, forevermore or at least until they change their password).

If anything is still unclear, please edit your question to clarify WHAT isn't 100% clear to you, and I'm sure we can help you further.

like image 149
Alex Martelli Avatar answered Nov 30 '22 11:11

Alex Martelli