The signature part contains bytes which represent a cryptographic signature of header and body (also encoded using Base64Url) and can be used to verify the authenticity of a token.
JWT tokens are mostly used as a mechanism for "stateless" authentication and authorization. Let's try to discuss what this means with a simple example:
In this picture, John is authenticating against an auth server. The auth server recognizes his credentials and gives him back a token. John can now use the token to connect to specific services.
When John makes a request to a service, he will attach his token. The service looks at the token to understand if the request is authorized.
The service can read the information embedded within the token to understand that the request is coming from John and can verify that the signature was applied by the Auth server.
This process is "stateless" because this validation can be done without having to make an explicit request to the Auth server. This is a great property for distributed systems or, in general, systems that deal with a high load of requests.
If you want to "debug" (or visualize) the content of a JWT token, you can use jwt.io or a CLI tool such as jwtinfo (github.com/lmammino/jwtinβ¦)
I hope this helps to shed some light on what JWT tokens are, how they work and when they can be used.
I posted this on dev as well, if you prefer a slightly more detailed format for this info: dev.to/loige/what-is-β¦
β’ β’ β’
Missing some Tweet in this thread? You can try to
force a refresh
How many times did you have to store settings (creds & other preferences)? Where do you save the conf file? Which format do you use? How do you load and update the file?
Conf takes care of all of this (and more!) with an extremely simple API
"Yo, why are #JavaScript and its ecosystem so messy?!" π‘
Well, I am glad you asked... Let me tell you a story! π€
π§΅π
For starting... #JavaScript was not designed to be the language that it is today!
JS was created in 1995 by @BrendanEich for Netscape, a web browser that was trying to come up with a language to make the web more interactive
@BrendanEich#JS wasn't related w/ #Java, so why did they call it Java-Script?! Duh! π³
Java was trendy! it was possible to build interactive sites by embedding Java apps in pages (applets). So it was mostly a #mktg move: "JS: the lightweight Java alternative" or something like that I guess
This is easy and it works! But the implementation is very specific to our struct.
The rest of the codebase doesn't really know that this type can be converted to a String and therefore you cannot build abstractions on top of this... π€¨
1οΈβ£Β You can't tell where a program is going to spend its time. Bottlenecks occur in surprising places, so don't try to second guess and put in a speed hack until you've proven that's where the bottleneck is.
2οΈβ£ Measure. Don't tune for speed until you've measured, and even then don't unless one part of the code overwhelms the rest.
Software engineering #anxiety, let's talk about it. Specifically, let me try to deconstruct my personal anxiety
π§΅π
1οΈβ£ classic impostor syndrome: it doesn't matter how good I actually am with some technology/tool/technique. Even if I can get the job done, it still feels far from adequate and I feel like I have to rush to get better to defend my job title & credibility...
2οΈβ£ future tech gamble: tech is always changing and I need to be ready for the next big thing if I want to stay relevant in the market. But what is the next big thing? I don't know, of course, so I try to check out as many things as I can and often end up feeling overwhelmed! π€―