1 00:00:00,300 --> 00:00:06,960 Now, let's try to understand what is the scenario where we want to customize authentication provider 2 00:00:07,350 --> 00:00:12,660 so that we can stop leveraging user detail service and password and codes. 3 00:00:13,050 --> 00:00:18,870 So think of a scenario where we have three applications, one application which accepts username and 4 00:00:18,870 --> 00:00:25,140 password, where the user interface controls and the request will go to the backend and the authentication 5 00:00:25,140 --> 00:00:26,820 will happen by the spring security. 6 00:00:26,970 --> 00:00:29,910 So this is a scenario which we are discussing as of now. 7 00:00:30,150 --> 00:00:36,390 So we just have a plain scenario and we are good with this scenario, with whatever Springs security 8 00:00:36,720 --> 00:00:37,300 provider. 9 00:00:37,590 --> 00:00:44,250 So spring security framework, how this scenario implemented for us in terms of user retail service, 10 00:00:44,400 --> 00:00:51,480 user details, manager password and coder, considering that this is the most famous way of doing authentication 11 00:00:51,810 --> 00:00:58,920 of end user inside any Web application or mobile application, but think of a scenario where you have 12 00:00:58,920 --> 00:01:07,470 an application which will accept either fingerprint or face recognition or iris scanning to authenticate 13 00:01:07,470 --> 00:01:07,980 the user. 14 00:01:08,250 --> 00:01:15,870 And at the same time, we may also have some application where we want to authenticate the user using 15 00:01:15,870 --> 00:01:20,040 the code that he receives to his email or mobile. 16 00:01:20,430 --> 00:01:24,270 So here a single organization have various scenarios. 17 00:01:24,270 --> 00:01:29,610 One is plain username and password, another use using fingerprint or face recognition. 18 00:01:29,850 --> 00:01:35,640 And the third scenario is like using your typical SO to handle all the scenarios. 19 00:01:35,790 --> 00:01:42,060 Obviously the default implementation provided by spring security in terms of user detail, service and 20 00:01:42,060 --> 00:01:49,980 password encoder is not good enough because in the scenarios of fingerprint scanning or face recognition 21 00:01:49,980 --> 00:01:58,950 or typical, I want to do my own authentication logic inside my authentication provider by implementing 22 00:01:58,950 --> 00:01:59,220 it. 23 00:01:59,370 --> 00:02:05,820 And spring security also allows you to maintain as many Nemeroff providers as you want. 24 00:02:06,120 --> 00:02:13,490 Like in this scenario, I can help all three providers implemental inside my application based upon 25 00:02:13,490 --> 00:02:15,330 the input coming from the user. 26 00:02:15,480 --> 00:02:21,630 The corresponding authentication provider will be invoked by the authentication manager, like our saying 27 00:02:21,930 --> 00:02:28,520 authentication manager will call authentication provider to perform the authentication of the user. 28 00:02:28,830 --> 00:02:36,330 So it's the responsibility of the authentication manager to call all the providers to one of the provider 29 00:02:36,330 --> 00:02:37,450 accepts that request. 30 00:02:37,530 --> 00:02:43,800 OK, this is the format that I was expecting and I can perform authentication for this format. 31 00:02:43,830 --> 00:02:50,280 And once that authentication provider provides the results, so based upon that authentication manager 32 00:02:50,520 --> 00:02:52,260 will perform the authentication. 33 00:02:52,780 --> 00:02:56,520 Now we understand what is a scenario that we have to customize. 34 00:02:56,520 --> 00:02:57,860 Authentication provider. 35 00:02:58,260 --> 00:03:02,810 Let's try to look into the core of the authentication provider. 36 00:03:02,820 --> 00:03:04,680 What are the methods that we have to go over? 37 00:03:05,250 --> 00:03:12,720 And also authentication manager interface also and how it manages all these providers that we are configuring 38 00:03:12,720 --> 00:03:13,710 inside the framework. 39 00:03:14,160 --> 00:03:14,640 Thank you. 40 00:03:14,640 --> 00:03:16,380 And see you in the next video by.