why is x-access-token header used for?

0 votes
Can anyone explain this?
Jun 27, 2019 in Others by shubham
• 6,910 points
2,639 views

1 answer to this question.

0 votes

To understand this we need to understand what is authentication?

Authentication is basically used to identify who you are. The basic Authentication includes username and password, which is used to identify who you are. But as we know that our HTTP is stateless we need to keep track of things to know what the user is doing. For example: An online shopping company, need to keep track of what your user is getting in each page or Online game should keep track on still which level the user has reached.

So to make that possible we make use of token, what token does it take your data and secret like 

jwt.sign(payload, secretOrPrivateKey, [options, callback])

and gives back a token which consists of three parts 

header: consist of the type of algorithm used to create the signature

payload: consist of data

signature: which consist of the encrypted part of the header and payload separated by a period

The best part of JWT is it lets you store the token in client side

So to send the token generated to the client side, we use the header X-access-token. For further sessions, this token is exchanged, not the username/password.

answered Jun 27, 2019 by sunshine
• 1,260 points

Related Questions In Others

0 votes
0 answers

explain what access modifier can be used for method

Sep 10, 2019 in Others by anonymous
33 views
0 votes
0 answers

why linux is more secure than windows?

which features make linux more secure than ...READ MORE

Jul 11, 2018 in Others by kristena1234
• 160 points
56 views
0 votes
1 answer

why linux is more secure than any other operating system?

First thing i would like to tell ...READ MORE

answered Jul 11, 2018 in Others by kristena1234
• 160 points
522 views
0 votes
1 answer

How is machine learning used to detect objects?

To understand the surrounding environment in real ...READ MORE

answered Nov 30, 2018 in Others by Kailash
82 views
0 votes
0 answers

why is x-access-token header used for?

Can anyone explain this? READ MORE

Jun 27, 2019 in Others by shubham
• 6,910 points
85 views
0 votes
1 answer

What does cors means in Angularjs and what the use of it?

CORS is Cross Origin Resource Sharing which means you ...READ MORE

answered Jan 29 in Web Development by kartik
• 4,380 points
69 views
0 votes
1 answer

how to safely deploy npm install without it causing inconsistencies?

The recent versions on npm generates a ...READ MORE

answered Apr 11, 2018 in DevOps on Cloud by DareDev
• 6,850 points
93 views
0 votes
2 answers

Send HTTP request in Java

import com.google.api.client.http.GenericUrl; import com.google.api.client.http.HttpRequest; import com.google.api.client.http.HttpResponse; import com.google.api.client.http.HttpTransport; import com.google.api.client.http.javanet.NetHttpTransport; import java.io.IOException; import ...READ MORE

answered Aug 3, 2018 in Java by samarth295
• 2,190 points
277 views
0 votes
1 answer

Why do we use Body-parser in Node.js?

For understanding this first you need to ...READ MORE

answered May 20, 2019 in Others by sunshine
• 1,260 points
1,913 views
0 votes
1 answer

What is a callback function?

Callback function is a function which is ...READ MORE

answered Jun 12, 2019 in Others by sunshine
• 1,260 points
126 views