In spring security, while configuring security for our end point, what else are bots we use previously?
Khanty-Mansiysk So Matchers is a method which will help you to exactly look for this and inpart and
try to secure it based upon the configurations that we don't like, has ruled authenticators or permit
or denial, whatever your requirement.
But beyond and matches, we also have other measures in spring security.
Let's try to go and understand what are the matches available and in what scenarios we should use that
basically spring security of three important types of matches.
One needs and this matches the second one is and matches and the last one is in the six months or so.
And matches and NBC matches are very similar with the very important difference that we can discuss
in the few minutes.
MVC Metcher, UTIs Spring, NBC Haggler mapping in prospect to match the path and the exact variables.
When we are dealing with NBC matches, we have two methods.
You can apply security based upon a pattern and method as well.
If you are passing a method and a pattern, that means you want to apply security based upon two parameters.
One is a Strittmatter and the pattern matching.
Whereas if you don't have any restrictions based upon its duty, better, which means only part has
to be restricted.
And I'm not worried about what our history is being called.
The certain areas will use the second method, which is NBC matches.
You can see the examples for the first one, NBC matches.
I am mentioning the bad example for the method post has to be authenticated, whereas if it is a extra
Metrojet, they should not be.
Any authentication involved should be permitted on beyond this.
To consider any request that comes, I have to deny all of them.
So it's clearly making sense for the first when someone is calling my example, Apapa with the post
request, which means they want to add or update some data.
I want them to be authenticated, whereas if they're just calling to get a request, which means they
just want to read the data, in such scenario, I will use Parmitano.
Similarly, if you have a simple requirement where any Web spot which matches with profile, slash,
edit, slash afterward, whatever is there in the path I want that blindly authenticate are protected.
You may have hundreds of pop like profile, slash, edit, slash, one, two, three.
It can be anything in certain areas.
We don't have to configure for each and every warrell inside our sprint security.
We can leverage these patterns.
And whenever you're using those stats that indicate any number of spots after the pop that you have
different.
For example, if I mention X, slash two spots, slash J, which means between X and J, there can be
any number of buttons.
So both X, Y, Z and X, Y and Z also will be treated as a same configuration.
Whereas if we use a single abstract map that indicates it will follow, exactly one path between them
are appropriate.
For example, if I says that it will exactly match X, Y, Z, but not X, Y and Z because it is an
extra pattern here.
So that's the difference between single and double Asterix.
So please make sure that you are using them properly mismatches.
We also have and matches and we are using it in our code.
Also, the method that we are using in our code is the second method, which is and match us with a
pattern similar to MVC matches also and matches how methods which will accept both his method and the
pattern, but compared with the matches and matches, has an extra method which will accept only a strict
method.
That means the security will be enforced based upon the history, the matter, but it will be always
ignored.
So it's almost equal as the matter with the history department, the two Asterix.
I'm not sure why people they want to have this extra tarm, but it's very similar to what we're seeing
in the first month.
So they both look very similar like and matches and we see matches.
But do we want them like why we need two different matches when they are very similar.
So as we discussed and we see matches.
Will you bring NBC back Batten's, whereas and machos is an implementation of and the style apartments,
so it is borrowed from the Apache style, but the primary difference is NBC match is more secure than
and match and Match will blindly look for the exact spot that you define, whereas in this match will
consider all other possible ways of accessing that.
But like if you see, if I try to secure a bottom slash actor with and matches, it will only perform
whatever authentication configurations that I have done for slash secured only, whereas NBC matches
will consider for Shakoor as well as slash, slash, slash Cadart SDMI or any extension.
That makes sense right when you're using NBC based applications because if you configure such a weather
slash schedule with and matches should be authenticated and I all others.
And in some scenarios if the user enter slash actor slash, what matches will do is it will be because
it's not matching with the slash, which is very risky.
So for all scenarios, we can use MVC matches.
But if feel confident that these kind of mistakes are not possible inside your application, you're
always free to go and use the and matches.
Be on NBC and matches.
We also have Riddick's matches.
Riddick's matches will provide you unlimited possibilities like our Java rejects.
They are also very similar where you can mention complex regex matches, like if you see the very first
method, which will allow both the method and rejects.
I can mention people who are trying to access my application with the get method, an English language,
Spanish and Chinese language.
There has to be authenticator and remaining.
Everyone should be doing that so far.
Such a complex requirement.
We can go ahead and use the regex matches.
So with this, I'm assuming you got an understanding of what a different matches available and how to
use them inside our application to in our core for simplicity purposes we are using and matches with
the background.
But you can always use the best actions based upon the history that as well.
Thank you.
And see you in the next week by.