cancel
Showing results for 
Search instead for 
Did you mean: 

How to redirect from one cmssite to another cmssite during login

0 Kudos

Hi Expert,

I have requirement something like redirect from one site to another site during login time.Here more explanation I have b2b site.If b2b customer belong to this site it works like same behaviour of OOTB.If b2b customer belong to another site then redirect to their site.

Example: If have two site like adidas.com and nike.com if i go to adidas shop login page and login with b2b customer if customer belong to adidas shop then go to adidas shop. if customer not belong to adidas. He belong to nike shop then redirect to nike shop from same login page. Please someone can suggest to me how to achieve this behaviour.

Thanks in advanced

BR,

Omkar

Accepted Solutions (0)

Answers (1)

Answers (1)

a_e_dubey
Active Participant

Hello omkar76 ,

Yes this is possible to achieve. I assume you have B2B sites here and B2BCustomer is trying to login.

So first you need look into B2BAcceleratorAuthenticationProvider class under B2bacc*addon. Once B2BCustomer tries to login for authentication here you can apply check. You can check your customer to which org it belongs and throws exception. Once you throw exception control flow thru LoginAuthenticationFailureHandler and here you can redirect to related B2BSite. Although you may face some cookie/url issue in local but if both site have diff url and cookies than it will work in local as well else you have to test in higher environment where url of both sites are different.

I hope this this will help you.