Тёмный

Configure the CSRF Protection With Spring Security 6 and Angular 

The Dev World - by Sergio Lema
Подписаться 13 тыс.
Просмотров 8 тыс.
50% 1

Опубликовано:

 

27 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 39   
@ferlezcano
@ferlezcano 11 месяцев назад
Great video! I'm using spring with CSRF disable since I can remember 😆
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema 11 месяцев назад
Thanks, I think most of the projects have CSRF disabled 😅
@fabricemissidi3301
@fabricemissidi3301 3 месяца назад
excellent content!! I'm ont from a anglophone country but i understand without problemes
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema 3 месяца назад
Thank you!
@prashlovessamosa
@prashlovessamosa 10 месяцев назад
Thanks for making this video.
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema 10 месяцев назад
You're welcome 😉
@dew_reddit
@dew_reddit 3 месяца назад
I don’t understand why the csrf was disabled in the SecurityConfig? Our security team has pointed out that it should not be disabled in Security Config
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema 3 месяца назад
It's another layer of complexity. It shouldn't be, but to speed up the development time, people disable it.
@gameshow4030
@gameshow4030 3 месяца назад
If i will put all these codes into wordpress will it still work? I struggle to find a tutorial that could explain whole coding system behind it and i just want to secure my website
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema 3 месяца назад
Using this workflow to protect your website is good. But there are other complements (like authentication, or even HTTPS). I'm not sure to understand what you want to do with Wordpress.
@praveenpotnuru6398
@praveenpotnuru6398 4 месяца назад
If a backend application hosted in multiple servers, how CSRF token will be validated?
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema 4 месяца назад
You need to share the session information between the servers. You can do it like this: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-YWVjnJsJRG0.html
@tryit5467
@tryit5467 6 месяцев назад
Please help me! I have permitted all endpoints using permitAll(), but only GET methods are accessible, whereas POST methods return a FORBIDDEN error " You don't have permission to access this". If I disable CSRF in the SecurityFilterChain, then POST methods without parameters can be accessed, but if there are parameters, they still return a FORBIDDEN error
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema 6 месяцев назад
How do you access the POST endpoints? via Postman, a terminal or a browser? Because the CSRF needs to set a cookie to identify the session. If you use Postman or a terminal, this is not done by default.
@mhmmdnaufall
@mhmmdnaufall 6 месяцев назад
but, how to secure endpoint that generate csrf token?
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema 6 месяцев назад
In fact, the CSRF endpoint is here to protect the authentication endpoint
@sridharlakshmipathy
@sridharlakshmipathy 5 месяцев назад
Yes I'm also having the same doubt, if it's not protected then attacker can also get csrf token from and pass it to next subsequent request
@sridharlakshmipathy
@sridharlakshmipathy 5 месяцев назад
​@@TheDevWorldbySergioLema can you clarify on this ?
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema 5 месяцев назад
The attacker can obtain a new CSRF token associated to its session. This means that it can hack my session because it's a different CSRF token.
@emerk92
@emerk92 6 месяцев назад
Thanks for this. i have one question: how can i test my backend with postman if i have csrf enabled? i tried getting first csrf token, but when i make post call, the csrf token of server is anredy changed..
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema 6 месяцев назад
Enable the connection of postman with a browser. Because the CRSF token needs to set the cookie of the session
@rajputADITYA_
@rajputADITYA_ 11 месяцев назад
Hi, great video!! Although I still get the 403 Forbidden issue after implementing the same code as shown in video. I'm developing one angular library for which I have the Spring boot layer for all the back-end calls. I don't require the login security as it's already there for Main app, I just need the CSRF validation for api calls. Awaiting your response 😊
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema 11 месяцев назад
Thanks! Do you have the cookies enable? Is is a stateful application?
@stefanfrusinoiu1311
@stefanfrusinoiu1311 9 месяцев назад
Hi,this was an amazing video on this subject.Havent seen anyone to explain how it works till now.Still i have one question remaining .From where can i learn about spring security in depth.Would be great if you can provide me some links for some resources.Thanks!
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema 9 месяцев назад
Thank you Stefan! What are you looking? Videos (Udemy or RU-vid), coaching, documentation?
@zayedh8089
@zayedh8089 11 месяцев назад
Hi could u please a authentification with token and security in the url and verification send mail with spring and angular please ??
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema 11 месяцев назад
A token in the URL is a bad practice, as the URL can be easily be traced. I've already done a video about the Authentication with token and Angular at ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-YUqi1IjLX8I.html. About the send mail, it can be interesting, let me add it to my TODO list 😉
@zayedh8089
@zayedh8089 11 месяцев назад
@@TheDevWorldbySergioLema couldd u please the sendermail with angular and spring ?
@gustavosantos1152
@gustavosantos1152 9 месяцев назад
Hi man, great video! However, I facing some troubles, can you help me?
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema 9 месяцев назад
Thanks Maybe. DM on Discord, LinkedIn or Facebook Messenger
@TheMrBazil
@TheMrBazil 7 месяцев назад
Why did you use here webMvcConfigurer? In other video you said to use Cors if we are using spring security: "If you use Spring Security, it's recommended to use this way instead of WebMvcConfigurer. This way, a CorsFilter is put in place which intercepts all the requests. With WebMvcConfigurer, not all the requests are intercepted, only those from the MVC Web."
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema 7 месяцев назад
Because I found the solution of using CorsConfigurationSource over WebMvcConfigurer after doing this video 😅
@TheMrBazil
@TheMrBazil 7 месяцев назад
@@TheDevWorldbySergioLema Okay thanks for fast answer! 😎
@kenduraghav
@kenduraghav 5 месяцев назад
Wonderful Tutorial
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema 5 месяцев назад
Thank you!
@sanamudash4976
@sanamudash4976 9 месяцев назад
how to set up with csrf repository for new token each request can you provide me any article for that.
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema 9 месяцев назад
Sorry, I don't have any article about that. What you have to do is make the frontend request the CSRF endpoint before each request. Nothing more The problem comes when you have several requests at the same time. I don't know how to handle this case.
@sanamudash4976
@sanamudash4976 9 месяцев назад
@@TheDevWorldbySergioLema thank you for reply.
@TheDevWorldbySergioLema
@TheDevWorldbySergioLema 9 месяцев назад
You're welcome!
Далее
Cross-Site Resource Forgery (CSRF) - Spring Security
49:57
КАК БОМЖУ ЗАРАБОТАТЬ НА ТАЧКУ
1:36:32
#31 Spring Security | CSRF Token
17:56
Просмотров 12 тыс.
Cross-site request forgery | How csrf Token Works
17:20
Cross Site Request Forgery - Computerphile
9:20
Просмотров 764 тыс.
Spring Security 6 with Spring Boot and JWT Tutorial
3:14:14
Realtime Chat App in React Native and AWS (Backend) 🔴
3:29:01