



You’re then issued a string with a JSON payload with things like your username, some user permissions, and an expiration date. As a user, you sign in to some trusted third-party the old fashioned way (with a username and password, for example). It may have some watermarks, an electronic chip, a barcode, something only seen under ultraviolet light plenty of ways for someone to verify its validity, but very difficult for you to recreate at home.Ī JWT is pretty much the same thing. You could put that information on any piece of paper, but a driver’s license has additional security. You can use your license to verify your name, birthday, address, etc. The government does the work to verify your identity and your ability to drive, then issues you a card with some information on it and an expiration date.
Decode token how to#
If you’re wondering, “I don’t know what a JWT is, or even how to pronounce it.” The official RFC specification says to just pronounce it like the word “jot.” As far as what a JWT is? Put simply, it’s a way to make a set of easily readable and verifiable claims that cannot be easily recreated without a secret key.Ī good analogy would be a driver’s license. You’ll learn how to decode the JWT and use it to make decisions about what to display on the screen. If you follow along, you’ll learn how to create an app in React with Okta as a third-party to authenticate users. Today I’ll shed some light on what exactly a JWT is, and how to use one in practice. They just need to know how to decode a JSON Web Token (JWT), rather than how to store a bunch of user information and pray they aren’t the next company with leaked passwords. That’s why many sites choose to use OAuth 2.0 to let a third-party handle authentication for them. Although authentication is a common requirement for web apps, it can be difficult to get it right, especially if you’re by yourself or part of a small team.
