1 00:00:00,240 --> 00:00:07,890 In spring security, while configuring security for our end point, what else are bots we use previously? 2 00:00:07,900 --> 00:00:15,090 Khanty-Mansiysk So Matchers is a method which will help you to exactly look for this and inpart and 3 00:00:15,090 --> 00:00:21,600 try to secure it based upon the configurations that we don't like, has ruled authenticators or permit 4 00:00:21,680 --> 00:00:24,030 or denial, whatever your requirement. 5 00:00:24,150 --> 00:00:28,460 But beyond and matches, we also have other measures in spring security. 6 00:00:28,620 --> 00:00:34,710 Let's try to go and understand what are the matches available and in what scenarios we should use that 7 00:00:35,190 --> 00:00:40,200 basically spring security of three important types of matches. 8 00:00:40,440 --> 00:00:46,940 One needs and this matches the second one is and matches and the last one is in the six months or so. 9 00:00:46,950 --> 00:00:53,250 And matches and NBC matches are very similar with the very important difference that we can discuss 10 00:00:53,250 --> 00:00:54,600 in the few minutes. 11 00:00:54,960 --> 00:01:03,120 MVC Metcher, UTIs Spring, NBC Haggler mapping in prospect to match the path and the exact variables. 12 00:01:03,570 --> 00:01:07,770 When we are dealing with NBC matches, we have two methods. 13 00:01:08,070 --> 00:01:14,480 You can apply security based upon a pattern and method as well. 14 00:01:14,640 --> 00:01:22,230 If you are passing a method and a pattern, that means you want to apply security based upon two parameters. 15 00:01:22,230 --> 00:01:25,230 One is a Strittmatter and the pattern matching. 16 00:01:25,350 --> 00:01:31,170 Whereas if you don't have any restrictions based upon its duty, better, which means only part has 17 00:01:31,170 --> 00:01:32,040 to be restricted. 18 00:01:32,040 --> 00:01:35,520 And I'm not worried about what our history is being called. 19 00:01:35,760 --> 00:01:39,510 The certain areas will use the second method, which is NBC matches. 20 00:01:39,720 --> 00:01:42,990 You can see the examples for the first one, NBC matches. 21 00:01:43,290 --> 00:01:51,870 I am mentioning the bad example for the method post has to be authenticated, whereas if it is a extra 22 00:01:52,190 --> 00:01:53,910 Metrojet, they should not be. 23 00:01:53,910 --> 00:01:58,260 Any authentication involved should be permitted on beyond this. 24 00:01:58,260 --> 00:02:02,420 To consider any request that comes, I have to deny all of them. 25 00:02:02,820 --> 00:02:09,870 So it's clearly making sense for the first when someone is calling my example, Apapa with the post 26 00:02:09,870 --> 00:02:14,280 request, which means they want to add or update some data. 27 00:02:14,310 --> 00:02:20,670 I want them to be authenticated, whereas if they're just calling to get a request, which means they 28 00:02:20,670 --> 00:02:25,760 just want to read the data, in such scenario, I will use Parmitano. 29 00:02:26,220 --> 00:02:33,980 Similarly, if you have a simple requirement where any Web spot which matches with profile, slash, 30 00:02:34,140 --> 00:02:42,360 edit, slash afterward, whatever is there in the path I want that blindly authenticate are protected. 31 00:02:42,520 --> 00:02:49,560 You may have hundreds of pop like profile, slash, edit, slash, one, two, three. 32 00:02:50,010 --> 00:02:52,140 It can be anything in certain areas. 33 00:02:52,440 --> 00:02:58,260 We don't have to configure for each and every warrell inside our sprint security. 34 00:02:58,410 --> 00:03:01,000 We can leverage these patterns. 35 00:03:01,020 --> 00:03:08,970 And whenever you're using those stats that indicate any number of spots after the pop that you have 36 00:03:08,970 --> 00:03:09,450 different. 37 00:03:09,450 --> 00:03:19,680 For example, if I mention X, slash two spots, slash J, which means between X and J, there can be 38 00:03:19,680 --> 00:03:20,730 any number of buttons. 39 00:03:21,240 --> 00:03:29,220 So both X, Y, Z and X, Y and Z also will be treated as a same configuration. 40 00:03:29,220 --> 00:03:36,930 Whereas if we use a single abstract map that indicates it will follow, exactly one path between them 41 00:03:36,930 --> 00:03:37,980 are appropriate. 42 00:03:38,220 --> 00:03:48,840 For example, if I says that it will exactly match X, Y, Z, but not X, Y and Z because it is an 43 00:03:48,840 --> 00:03:50,120 extra pattern here. 44 00:03:50,460 --> 00:03:54,390 So that's the difference between single and double Asterix. 45 00:03:54,540 --> 00:03:59,550 So please make sure that you are using them properly mismatches. 46 00:03:59,550 --> 00:04:03,270 We also have and matches and we are using it in our code. 47 00:04:03,270 --> 00:04:09,360 Also, the method that we are using in our code is the second method, which is and match us with a 48 00:04:09,360 --> 00:04:17,430 pattern similar to MVC matches also and matches how methods which will accept both his method and the 49 00:04:17,430 --> 00:04:24,940 pattern, but compared with the matches and matches, has an extra method which will accept only a strict 50 00:04:25,230 --> 00:04:25,740 method. 51 00:04:25,740 --> 00:04:32,220 That means the security will be enforced based upon the history, the matter, but it will be always 52 00:04:32,230 --> 00:04:32,660 ignored. 53 00:04:32,940 --> 00:04:39,210 So it's almost equal as the matter with the history department, the two Asterix. 54 00:04:39,390 --> 00:04:46,740 I'm not sure why people they want to have this extra tarm, but it's very similar to what we're seeing 55 00:04:46,740 --> 00:04:47,820 in the first month. 56 00:04:48,120 --> 00:04:51,630 So they both look very similar like and matches and we see matches. 57 00:04:51,630 --> 00:04:57,390 But do we want them like why we need two different matches when they are very similar. 58 00:04:57,570 --> 00:04:59,760 So as we discussed and we see matches. 59 00:04:59,940 --> 00:05:08,400 Will you bring NBC back Batten's, whereas and machos is an implementation of and the style apartments, 60 00:05:08,650 --> 00:05:16,590 so it is borrowed from the Apache style, but the primary difference is NBC match is more secure than 61 00:05:16,590 --> 00:05:25,800 and match and Match will blindly look for the exact spot that you define, whereas in this match will 62 00:05:25,800 --> 00:05:29,940 consider all other possible ways of accessing that. 63 00:05:29,950 --> 00:05:38,520 But like if you see, if I try to secure a bottom slash actor with and matches, it will only perform 64 00:05:38,520 --> 00:05:45,870 whatever authentication configurations that I have done for slash secured only, whereas NBC matches 65 00:05:46,080 --> 00:05:54,030 will consider for Shakoor as well as slash, slash, slash Cadart SDMI or any extension. 66 00:05:54,390 --> 00:06:00,260 That makes sense right when you're using NBC based applications because if you configure such a weather 67 00:06:00,390 --> 00:06:06,900 slash schedule with and matches should be authenticated and I all others. 68 00:06:07,140 --> 00:06:14,670 And in some scenarios if the user enter slash actor slash, what matches will do is it will be because 69 00:06:14,670 --> 00:06:18,030 it's not matching with the slash, which is very risky. 70 00:06:18,810 --> 00:06:22,350 So for all scenarios, we can use MVC matches. 71 00:06:22,500 --> 00:06:28,500 But if feel confident that these kind of mistakes are not possible inside your application, you're 72 00:06:28,500 --> 00:06:30,760 always free to go and use the and matches. 73 00:06:31,110 --> 00:06:33,580 Be on NBC and matches. 74 00:06:33,840 --> 00:06:36,030 We also have Riddick's matches. 75 00:06:36,360 --> 00:06:43,110 Riddick's matches will provide you unlimited possibilities like our Java rejects. 76 00:06:43,320 --> 00:06:50,310 They are also very similar where you can mention complex regex matches, like if you see the very first 77 00:06:50,310 --> 00:06:53,430 method, which will allow both the method and rejects. 78 00:06:53,670 --> 00:07:03,120 I can mention people who are trying to access my application with the get method, an English language, 79 00:07:03,240 --> 00:07:05,330 Spanish and Chinese language. 80 00:07:05,520 --> 00:07:08,100 There has to be authenticator and remaining. 81 00:07:08,100 --> 00:07:10,010 Everyone should be doing that so far. 82 00:07:10,060 --> 00:07:12,140 Such a complex requirement. 83 00:07:12,300 --> 00:07:15,720 We can go ahead and use the regex matches. 84 00:07:15,960 --> 00:07:23,130 So with this, I'm assuming you got an understanding of what a different matches available and how to 85 00:07:23,160 --> 00:07:30,780 use them inside our application to in our core for simplicity purposes we are using and matches with 86 00:07:30,780 --> 00:07:31,950 the background. 87 00:07:32,040 --> 00:07:37,120 But you can always use the best actions based upon the history that as well. 88 00:07:37,290 --> 00:07:37,920 Thank you. 89 00:07:37,920 --> 00:07:39,630 And see you in the next week by.