Spring Boot Method Security with @PreAuthorize | Coding with BibBobBib

Pubblicato il: 11 maggio 2024
sul canale di: 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


In questa pagina del sito puoi guardare il video online Spring Boot Method Security with @PreAuthorize | Coding with BibBobBib della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Coding With BibBobBib 11 maggio 2024, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 506 volte e gli è piaciuto 7 spettatori. Buona visione!