Spring Boot Method Security with @PreAuthorize | Coding with BibBobBib

Veröffentlicht am: 11 Mai 2024
auf dem Kanal: Coding With BibBobBib
506
7

HEJA coding people, I hope you're well.

CONTENT
Learn how to secure individual Spring Boot methods using Spring Security and the @PreAuthorize annotation.

In this coding session, I’ll demonstrate method-level authorization with a Spring Boot application containing two protected REST API endpoints. We’ll test different user roles and credentials with Postman, then walk through the Maven dependencies, controller annotations, and security configuration.

WHAT YOU’LL LEARN
Understand method-level security in Spring Boot
Use `@PreAuthorize` to restrict access by role
Enable method security in the Spring Security configuration
Protect individual REST API endpoints
Test authenticated and unauthorized requests with Postman
Understand the difference between authentication and authorization

TIMESTAMPS
00:00 Introduction | Coding Session 20
00:05 Spring Security documentation
00:27 Test the secured REST API with Postman
01:13 Code walkthrough
01:14 Maven dependencies
01:37 Protect endpoints with `@PreAuthorize`
02:15 Spring Security configuration
02:55 Review the tests and implementation
03:58 Questions and comments
04:38 More coding sessions

Follow along to see what comes next.    / @codingwithbibbobbib  

TOOLS
Intellij IDEA Community Edition, postman

TECHNOLOGIES
Spring Framework 3.2.5, Spring Boot, Spring Security, maven, java 17 .

TIPP CODING SESSIONS
Mocking API Data with Examples In Postman:    • How to Create a Mock Server in Postman | C...  

MUSIC
licensed with Epidemic Sound
https://www.epidemicsound.com

#codingwithbibbobbib, #restapi, #springsecurity, #coding #howto, #codingsession, #springboot #springboottutorial, #bibbobbib


Auf dieser Seite können Sie das Online-Video Spring Boot Method Security with @PreAuthorize | Coding with BibBobBib mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Coding With BibBobBib 11 Mai 2024 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 506 Mal angesehen und es wurde von 7 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!