why is x-access-token header used for

0 votes
Can anyone explain this?
Jun 27, 2019 in Others by shubham
• 7,340 points
18,570 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,300 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
500 views
0 votes
2 answers

Is Peterson’s Algorithm a good solution for Critical Section problem? If yes, then why? If no, then why?

Peterson’s solution provides a good algorithmic description ...READ MORE

answered Jul 6, 2020 in Others by Gitika
• 65,770 points
2,261 views
0 votes
1 answer

what is microsoft azure used for?

Microsoft Azure is used as a cloud ...READ MORE

answered Jun 21, 2023 in Others by Khan Sarfaraz
• 700 points
501 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, 2019 in Others by shubham
• 7,340 points
977 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, 2020 in Web Development by kartik
• 37,520 points
4,302 views
0 votes
1 answer
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,890 points
983 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,300 points
8,021 views
0 votes
1 answer

What is a callback function?

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

answered Jun 13, 2019 in Others by sunshine
• 1,300 points
1,175 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP