I'm having some trouble figuring out if DNN has the capability to redirect a user that is being validated to a URL on a different portal within the same site.
For example, say I have PortalA and PortalB, and a User1 that has only access to PortalB. However, I do want to allow for the user to attempt to use the Login page for PortalA, and some logic to determine that the user needs to be directed to PortalB during or after the login process. So, if User1 visits the site PortalA.com and attempts to login, I want User1 to end up being validated and logged in to PortalB, and landing on the home page for PortalB.
Looking at the PortalSettings object, I tried the PortalId and the PortalName that goes into the UserController.ValidateUser and UserController.UserLogin methods, but that does not help with any redirection across two portals. I also took a look at the changing HomeTabId variable that is used for obtaining the RedirectURL and it seems that changing that to an Id that is for the Home Page does not work - because the HomeTabId is outside of the current portal, Globals.NavigateURL() does not give me the URL to the correct portal I want to be redirected to.
I also tried to skip going to the OnUserAuthenticated event when the validation is a success for the intended portal, and then calling the UserLogin method then trying to redirect using Response.Redirect(Globals.NavigateURL()) with the correct URL, but that did not seem to be working either (I get stuck on the same page).
Additionally, there is a need to be able to determine on either PortalA or PortalB's login page, if the user logging in has access to both portals. If they do have access to both portals, then the user would be able to select (from a list, drop down, etc.) which Portal they are wanting to go to. From the selection, the user could then continue on to PortalA or PortalB FROM either PortalA or PortalB's login page as needed. I imagine that if the prior requirements can be solved, then this should be easily solved.
Just in case, there are business rules that dictate that we do need separate portals. Each portal has portal specific functionality, business logic engines, and navigation menus.
I did take a look at: and the response by Chris H., but the answer provided is not enough to solve my issue (we're using DNN Community edition, and I've already got the users set up for which portal they have access to).
EDIT: These portals are on the same domain. So, it'll look like portal1.mydomain.com and portal2.mydomain.com.
EDIT2: I'm currently thinking about doing the portal redirection before the attempt to validating and logging the user in. However, I would need to figure out how to carry over the sensitive user login information across the two portals - I'm not sure if attempting to carry over the data in session temporarily would work, since they're across two portals. I noticed already that if I log in with User1 to PortalA and then change the URL to PortalB, I would have to login again even though User1 has access to both portals. Would attempting to do the portal redirection before the login step be a reasonable approach, or should that be done after the fact?