Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why do we need to prefix 'JWT ' to token? #1

Open
MeVimalkumar opened this issue Jun 14, 2017 · 2 comments
Open

Why do we need to prefix 'JWT ' to token? #1

MeVimalkumar opened this issue Jun 14, 2017 · 2 comments

Comments

@MeVimalkumar
Copy link

Hello,

I was following your tutorial from youtube it works fine,
You explained it very well, thank you for that.
I just have a little query why do we need to prefix 'JWT ' to token while sending a response back.
By the way with prefixing 'JWT ' it works fine but as soon as I remove 'JWT ', it didn't work, I'm wondering why this is happening? any specific logical or syntactical reason?

@ashishrawat13
Copy link

can you tell me in which line this is written

@lyamiver
Copy link

Maybe
JWT defines a special structure of information that is sent over the network. It comes in two forms, serialized and deserialized. The former is used directly to transmit data with requests and responses. On the other hand, to read and write information to a token, it needs to be deserialized.

Also because JWT is one of the most common methods of authentication for requests to Java WEB applications and this type of protection and authentication has several advantages:

convenience (no need to pass login and password with every request);

less queries to the database (the token may contain basic information about the user);

easy implementation (it's enough to use a ready-made library to generate and decrypt a token)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants