why is x-access-token header used for?

0 votes
Can anyone explain this?
Jun 27 in Others by shubham
• 6,870 points
33 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 by sunshine
• 1,200 points

Related Questions In Others

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
27 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
125 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
49 views
0 votes
1 answer
0 votes
0 answers

why is x-access-token header used for?

Can anyone explain this? READ MORE

Jun 27 in Others by shubham
• 6,870 points
13 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,810 points
57 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
90 views
0 votes
1 answer

Trying to call AWS API via PHP

Try using AWS SDK for PHP, Link ...READ MORE

answered Jun 6, 2018 in AWS by Cloud gunner
• 4,260 points
202 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 in Others by sunshine
• 1,200 points
29 views
0 votes
1 answer

What is a callback function?

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

answered Jun 12 in Others by sunshine
• 1,200 points
48 views