Hi this post might be what you are looking for: https://www.dcaric.com/blog/how-to-intercept-the-user-provider-in-episerver-10
Thanks for prompt response. Yes, provided link is helpful. Can you please point out where this interceptor code should be written. Do we need to write add on? I am going through QuickSilver application. Let say if someone ask me to intercept the user creation module of QuickSilver, where should I implement the code. Should I add the provided interceptor code directly in QuickSilver or need to write it separatly? Please help, I am bit confused in writing code directly or through addon.
You need to register your interceptor using initialization module. It's a regular C# class which can be created anywhere in your solution.
Ok, so can someone confirm my understanding below on overriding existing functinality??
For eg, if I have to call a web service (in Quick silver application) of another system while creating user, should I do the following:
You should use IInterceptor only if you have to. For example, site administrators insist on using the built-in views, or you're building an add-on and don't have control over other people's code...
Otherwise, it's much better to create a custom registration form.
I don't think that separate project/class library is necessary unless you're building something that will be used in several projects and/or packed as a NuGet package.
Are you trying to make changes to cms users or customers in Commerce Manager?
Can you describe in more detail what you're trying to solve?
Basically, I am referring Quick silver application available on Git and I want to integrate QuickSilver with my application. QuickSilver provides CMS and Commerce features. On creating user in CMS, I want to create the same user in my system using REST API available at my end.
Currently when I place the cursor on "Create User" menu in QuickSilver, it shows the navigation path as "episerver/CMS/Admin/EditUser.aspx" but this page is not available in application for change. It resides under Modules/_protected/CMS/CMS.zip".
I am trying to find out a place to call my service on user creation in QuickSilver CMS. Can you please give me a pointer.
The simplest solution would be to create a user registration controller in EPiServer.Reference.Commerce.Site project.
You can borrow the code from Alloy sample project (RegisterController).
This controller will then make rest calls, etc.
If you want to use the built-in view (episerver/CMS/Admin/EditUser.aspx), then you can solve this with an interceptor.
UserProviderInterceptor and UserProviderInterceptorModule from my blog post can be created anywhere in your project (EPiServer.Reference.Commerce.Site). Episerver will pick them up on application start.
Rest communication should be done in CreateUser, UpdateUser and DeleteUser methods of UserProviderInterceptor.
No need for NuGet packages, add-ons, etc.
Hope this helps!
Hi Dejan, Thanks for the pointer. Intercaptor is working as expected. Can we create Interceptor on product creation as well Like let say want to intercept while adding Book title in catalog??
You should use IContentEvents for that. http://www.jondjones.com/learn-episerver-cms/episerver-developers-guide/episerver-event-handling/how-to-hook-into-the-episerver-cms-events-pipeline
Is this possible to customize or extend the functionality of existing module. Let say while creating user in CMS, I want to create same user in other system (integration) and want to add the other system's user id in existing EPI user's metadata field. This way I can relate the users of 2 different system. Please suggest if this is achivable.