I have a custom authentication provider that is working well but it doesn't support ReturnURL seems.
The Login class inherits from AuthenticationLoginBase and it has a piece of code like this:
UserLoginStatus loginStatus = validStatus == UserValidStatus.VALID ? UserLoginStatus.LOGIN_SUCCESS : UserLoginStatus.LOGIN_FAILURE; if (loginStatus == UserLoginStatus.LOGIN_SUCCESS) { SetLoginDate(username);
// Raise UserAuthenticated Event var eventArgs = new UserAuthenticatedEventArgs(userInfo, userInfo.Email, loginStatus, config.DNNAuthName) { Authenticated = true, Message = "User authorized", RememberMe = false }; OnUserAuthenticated(eventArgs); if (Request.Params["RelayState"] != null) { string redirectUrl = HttpUtility.UrlDecode(Request.Params["RelayState"]); Response.Redirect(redirectUrl); }
Notice how it calls OnUserAuthenticated(...). The problem is that after this call it never comes back, so all code that goes after this line is not executed.
And so the RelayState parameter that contains the url the user should be redirected to is never done.
Is there a way to force DNN to know that it has to return to a specific url after the login is completed? if so how?
Normally that event is called last. Maybe you can create an alternative method async to run the same logic in your provider?
These Forums are for the discussion of the open source CMS DNN platform and ecosystem.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.