Spring Security in a Spring Boot App with Example | Tech Primers

preview_player
Показать описание
This video covers Spring Security integration in a Spring Boot Application with an example app.

📌 Related Playlist
================

🎬Video Editing: iMovie

---------------------------------------------------------------
🔥 Disclaimer/Policy:
The content/views/opinions posted here are solely mine and the code samples created by me are open sourced.
You are free to use the code samples in Github after forking and you can modify it for your own use.
All the videos posted here are copyrighted. You cannot re-distribute videos on this channel in other channels or platforms.
#SpringSecurity #SpringBoot #TechPrimers
Рекомендации по теме
Комментарии
Автор

Hi,
Tutorial was really helpful for me to get a basic understanding about spring security.
One thing I need to add: Since you have annotated the CustomeFilter class with @Component it is automatically added as a filter. That is why that code is executed even though you commented out the "addFilterBefore" method call. If you would remove @Component annotation, then the filter will not get added implicitly

nishadaliyanage
Автор

Simply understand how to implement security.Thank u for share this video

ausularakeshkumar
Автор

One of the best tutorial and it has cleared all my basic query. Thanks for this and keep it up with good work brother.

jigneshsaliya
Автор

Just a quick note, with newer versions of spring, when following the tutorial, at around 13:47, after you have provided the roles, and you resend the get request, if you still dont get a response, ie.. you get an empty response from postman, you may get the following error:

There is no PasswordEncoder mapped for the id "null"

" When you store the users in memory, you are providing the passwords in plain text and when trying to retrieve the encoder from the DelegatingPasswordEncoder to validate the password it can't find one that matches the way in which these passwords were stored." - Stack overflow.

to solve this issue, simply add {noop} to the password string like so ->

CarlSaptarshi
Автор

Using Ctrl(Command) + O in IntelliJ IDEA brings up a list of all overridable methods in all superclasses or implementing interfaces, for you to choose from, and Ctrl(Command) + I brings a list of abstract methods to be implemented in superclasses or implementing interfaces

phillable
Автор

Good try tech primers. All the best for future videos.
I'll try to share your channel as much as possible.
Good Work.
:)

kuldeepbisen
Автор

Ajay, its really good. Dont feel bad! Its a tough subject. Spring Security has been there for a very long time and there are a lot of things to know. Most of the companies dont use application level security as they use multi-level, multi-layered security approaches (its up to their Enterprice Architecture group). But this is a great introduction and job well done bro!

kaipulla
Автор

Awesome tutorial to learn Spring Security. You have made the things very simpler sir :)

AshishBurnwal
Автор

Nice video and to the mark. Thanks for sharing this!

nupursharma
Автор

Use noop when authenticating password.Ex:- .password("{noop}test") so that basic authentication works.

sanjaykantheti
Автор

At 16:30 please provide "/**/hello" as antMatchers to make the authorization works. At around 24:45 add this line "filterChain.doFilter(servletRequest, servletResponse);" at the end of doFilter method to see userPrincipal. In spring 5 you have to provide the password with "{noop}" prefix, as Carl Saptarshi described below.

kkojott
Автор

Actually you will get the user Principal inside the CustomFilter. Not sure why but it is observed that the CustomFilter is called 3 times. We will get the Principal object during the 3rd time, the first 2 times being null

viswanathn
Автор

Hi Tech Primers.
= true) annotation on SecurityConfiguration class will solve your problem of role based authorization.
Cheers!!

mandardongare
Автор

Thanks for tutorial helped me a lot :)

varunjn
Автор

Awesome, will it be possible to add database credentials provider in a quick video.

murari-goswami
Автор

Filters got worked may be because of you added the @component on top of filter implementaiton

ankatvijay
Автор

Hello. Do you have any video which covers Feign Client Configuration which can be used to access a secured endpoint? I mean with the RequestInterceptor. Most of the videos cover securing the actual API but accessing is using a Client like OAuth2RestTemplate, FeignClient etc. This gets even more complicated in the context of Microservices. Please point me to the tutorial if you have one. Thanks in advance.

knowledgeseeker
Автор

Could you please provide one example for form based authentication, whatever you'd given in demo was of Basic Authentication..

vidyasagarareddy
Автор

Hello Ajay, It was really helpful but I have a concern at one place. I had to prepend {noop} in the password string with inMemoryAuthentication. Can you please explain

chandan
Автор

Nice Tuts...
Could you create a proper Spring - AngularJS - Bootstrap tutorial series(along with auth)?

Not much tuts are available online.

gauravdighe