Spring Security JWT Role-Based Authorization Tutorial

preview_player
Показать описание
In this Spring Security JWT video, I'd love to share with you guys, about how to implement Role-based Authorization for REST APIs with JWT in Spring Boot application.

In details, you'll learn:
- Add Roles (authorities) to Users
- Store user’s authorities in JWT
- Parse user’s authorities from JWT
- Add authorization to REST APIs using @RolesAllowed provided by Spring Security Config
- Test JWT Role-based Authorization using Postman program

Timestamps:
00:00 Intro
00:13 What you'll learn in this video
00:49 Based on previous video
1:09 Roles allowed on API endpoints
4:11 Test Current APIs using Postman
12:35 Add Roles to Users
30:32 Store User's Authorities in JWT
35:25 Parse User's Authorities from JWT
44:45 Add Authorization to REST APIs
48:55 Test API Authorization using Postman

#restapis #jwt #springsecurity #springboot #java #authorization #oauth2
Рекомендации по теме
Комментарии
Автор

thank you soo much broo... I made my crazy for days, because of jwt and authorization problem, finally I have just seen your video ...

caglarpeker
Автор

After I have the token, how do I put the token in the header without using Postman? Could you please show me how to do this using only Java code?

khanhtran
Автор

wheres the spring security 6 version? this method is deprecated

securethebag
Автор

hello, i was trying for weeks to make the program without WebConfigurationAdapter, to work, it did not . it look like missing something. is it possible to show the complete program source code. if you want. thanks

gt-ujfz
Автор

user.getRoles().toString() is empty but user entered through parameter. Could you help me?

nodirbeknurqulov
Автор

Tại sao em cài đặt là @RolesAllowed("ADMIN") nó lại từ chối truy cập trong khi role trong database của em vẫn là "ADMIN" ạ:((

quocbaonguyen
Автор

Hi, Adding a roles to the jwt (claims) I think not a good practice as well ... just feach them and add it to local storage in the client side in order to get updated it one each time. plz let me know what do u think ?

besooab
Автор

Hi Sir can you tell me how to catch 403 Forbidden Exception when a role which is not allowed but try to it the url?

SatyakiSaha
Автор

This is good, you should produce more tuts on this JWT section

ktn
Автор

Sir can you make video on distributed security using jwt Or oauth2

FunnyZone-yjkl
Автор

Could you update the code based on Spring Boot 3.x.x? Thanks

hendisantika
Автор

@RolesAllowed is not working, changed it to @Secured and its working...

Ubaid_Shahbaz
Автор

Awesome bro...this video helps me a lot...need more and more videos excepted

nagapravallikaraja
Автор

Hi bro do you have videos of apache kafka?

ramosespann
Автор

Thank you ! Could you please explain Auth2 with real-life example ?

IgorV
Автор

i am really helped while learning jwt and spring security, thank you very much for this tutorial!
i wanna ask, can we have permission for the user when doing Authorization for each API? if yes, can you help with video tutorial like this? if it too short maybe a blog post will do :)

PixelLoafLatte
Автор

Hi Nam, Can you make video Spring Security with Nimbus JWT that Spring Security supports this out of the box? and its still very rare implementation tutorial with Spring in youtube and the internet. Thank you in advance

helmigandi
Автор

can you share github repo link to get source code?

anhay
Автор

that what i need, thank mentor very much !

huyledinhanh
Автор

Thanks a Lot, Very good Tutorial ....

antoniosanjuanes