In this video, let's try to configure the security of the services that we developed as per our equipment,
so like we are seeing in the last few videos, by default, spring security will try to secure all the
services that we configure inside the project to preview that, let's try to go and do some pants on
in court right now.
What I'm trying to do here is like I just created a package Kondrat Easybeats config on inside that
I created a new class called Project Security Conflict.
So this is my last name.
And I have annotated with the configuration annotation, which is an indication to my spring cantine
that this is a configuration class and it has to consider while putting on the application.
One of the basic thing that we have to do whenever we try to customize the spring security aspect our
needs is we have to extend this Web security Conficker around.
So this is the most important class inside spring security framework where we extend and orient the
methods available inside it as part of our requirements.
If you see here, I'm just trying to write a method called Conficker, which accent the parameters of
security.
As of now, I didn't implement anything inside this method.
But to show you what the default configurations construct by spring security for all the rest services
or any authentication you are allowed that we try to build in our application.
You can go inside this class and you can look for this Conficker.
I'm trying to go inside the class and this is a security library.
You can see this is the jobs that I have downloaded using spring starter projects and Mavin.
And inside this class, I am searching for a configure method which accepts strategic security as a
parent.
If you see here, the default implementation of this method is any request that comes to inside.
Our application has to be authenticated, authenticated in the sense any you are or any other service
that I have in my application, it has to be validated by credentials.
A user has to be authenticate himself.
And at the same time we have an end condition saying that all the request has to be authenticated,
all you orals, and this has to happen for all form login.
And it's pretty basic form.
Login is the method which indicates my spring security, all the browser requests coming through forms
like login from my contact form and at the same time historically basically is a method which indicates
all the requests coming through my back and APIs like I may be calling through some other Java code
through back and by using this template.
In the case of Posman, we are also trying to call that through the back.
There's no way and to be basic indicates that and form login indicates something trying to call from
the browser and you can see by default, bring security, expect every request.
Any request means any request that is coming to it has to be authenticated.
And this applies to both form login and add to what I will do.
Yes, I'll try to copy paste and implement the same into my project security config class.
Also post that I will go to my spring security starting boot application class here.
I have added another component scan, which is the package that we added and since we have multiple
packages I am using component scans is an annotation, which is accept an array of components and annotations.
So this will tell my springboard application.
Go ahead and scan for these packages and to us inside these packages and it will look for all the controllers
wrist controllers and it will build the restabilize and at the same time inside the config, it will
try to look what the customization that we are trying to do.
And as is shown right now, we are going with the default implementation of the spring security.
That means every request that inside my application there are six services.
All these six services has to be authenticate themselves before processing the business.
So this is the default behavior.
Let's try to see what will happen if we try to start services using this code.
Let's try to start this application with this code that we have copy paste from the spring security
framework and see how the application behaves as.
But understanding this has to be nothing different.
What we have to start before, because we are going right now with the default implementation itself
even.
In our spring security custom, best that I came to Bozeman and I'm going to call my cards without any
authorization details we should expect for zero one.
Now, if I go and provide the authentication details, which we can't figure, we should get a proper
response.
The same applies for all the services like my iPhone, as you can see.
Here are the account details from the database.
So it is confirmed by default spring security.
Expect every Warrell to be secured inside your application in next video.
Let's try to configure our project.
Thank you.
By.