How to verify a JWT token in Java | JWT, Keycloak, RSA256 and Auth0

  Рет қаралды 16,735

PS After Hours

PS After Hours

Күн бұрын

In this video, I will show you how to validate the JWT token in a Java application. We will use the Auth0 library to check if a Keycloak issued JWT token comes from a trusted issuer if the signature verification (RSA256 in this case) is correct and if the token has not expired yet.
As part of the process, we will also load the Keycloak public key and talk about storing the public key locally and how to make everything faster with guava cache.
We will wrap everything in a nice JwtValidator class to be used anywhere you want to.
What are JWT tokens and how to use them: • What is JWT? The JSON ...
Code example: github.com/ps-after-hours/jwt...
#quadmeup #jwt #keycloak
If you want to support me:
✅ Patreon / pawelspychalski
✅ Banggood affiliate bit.ly/2P8oAxr
✅ Paypal paypal.me/pawelspychalski
▶ Discord server quadmeup.com/discord
▶ My website quadmeup.com/

Пікірлер: 19
@PSAfterHours
@PSAfterHours 2 жыл бұрын
What are JWT tokens and how to use them: kzfaq.info/get/bejne/b9RyqJii2bzcfYE.html
@himanshutech8320
@himanshutech8320 8 ай бұрын
excellent video explaining what is required to validate the token.
@chanakadushmantha3775
@chanakadushmantha3775 7 ай бұрын
most explained video on KZfaq for jwt validation.
@mikedodds1227
@mikedodds1227 5 ай бұрын
This video and supplies code was very helpful to me. Thanks!
@ahmadalkhatib3487
@ahmadalkhatib3487 2 жыл бұрын
You made it absolutely clear, Thanks !
@PSAfterHours
@PSAfterHours 2 жыл бұрын
Glad it helped!
@juroltv3119
@juroltv3119 Жыл бұрын
Thank you, so much sir. This really helps me, I can now go to bed peacefully 😅
@manikantamani3054
@manikantamani3054 2 жыл бұрын
Salute for you🙏🏻 saved me
@PSAfterHours
@PSAfterHours 2 жыл бұрын
glad I could help1
@user-pp3rs6qz3o
@user-pp3rs6qz3o Жыл бұрын
Thank you so much. That is great!
@PSAfterHours
@PSAfterHours Жыл бұрын
Thanks
@manikantamani3054
@manikantamani3054 2 жыл бұрын
Much Thanks 🙏🏻
@PSAfterHours
@PSAfterHours 2 жыл бұрын
You're welcome!
@user-cf2jo7vo8p
@user-cf2jo7vo8p 10 ай бұрын
Cool🎉❤
@mritunjaydwivedi1753
@mritunjaydwivedi1753 8 ай бұрын
Explained very nicely. I have some points though, I am actually interested as Keycloak was mentioned. 1. ES256 algo curve P-256 public key using OpenSSL commands import the public key in keycloak throws an error. InvalidKeySpecException: Encode key spec did not recognize: algorithm identifiers ***** 2. RS/HS256 JWT is working. 3. Added ES256 provider in Keycloak. Am I supposed to make some custom implementation in keycloak adapters?
@davolidobry
@davolidobry 2 жыл бұрын
How to deactivate JWT at backend? It is needed to blacklist them? Are we forced to log out at frontend-only (by deleting token from our client)?
@PSAfterHours
@PSAfterHours 2 жыл бұрын
1 - keep access token short lived - if you deactivate the user then he would have to relogin with refresh token 2 - token can not be revoked. You can have a "blacklist" of revoked tokens, but if they are short lived (a few seconds) that it makes no sense to be honest 3 - if user logs out, then you have to remove the token from the client (assuming you have the control over the client app)
@cbsflows1041
@cbsflows1041 2 жыл бұрын
Pawel i try to contact you about somethings. Is there any email adres to contact you?
@PSAfterHours
@PSAfterHours 2 жыл бұрын
sure, pspychalski@gmail.com
What is JWT? The JSON Web Token introduction
7:01
PS After Hours
Рет қаралды 3,8 М.
What is JWT? JSON Web Tokens Explained (Java Brains)
14:53
Java Brains
Рет қаралды 1 МЛН
WHO LAUGHS LAST LAUGHS BEST 😎 #comedy
00:18
HaHaWhat
Рет қаралды 22 МЛН
🤔Какой Орган самый длинный ? #shorts
00:42
Now THIS is entertainment! 🤣
00:59
America's Got Talent
Рет қаралды 36 МЛН
Keycloak Access Token Validation | Backend JWT Verification
14:53
hexaDefence
Рет қаралды 3,4 М.
Why is JWT popular?
5:14
ByteByteGo
Рет қаралды 293 М.
JWT claims explained: registered, public and private
5:20
PS After Hours
Рет қаралды 4,7 М.
How to Build and Parse JWTs in Java with JJWT
16:33
OktaDev
Рет қаралды 14 М.
ID Tokens VS Access Tokens: What's the Difference?
8:38
OktaDev
Рет қаралды 150 М.
JWT best practices for max security
4:50
PS After Hours
Рет қаралды 7 М.
What's the BEST open source license for your project?
8:43
PS After Hours
Рет қаралды 3,3 М.
Difference between cookies, session and tokens
11:53
Valentin Despa
Рет қаралды 602 М.
What is the structure of a JWT - Java Brains
17:46
Java Brains
Рет қаралды 398 М.