I'm using the asp.net login control and a switcher to get my users to authenticate against an external database. I am now explicitly referencing my membership provider.
Using switcher:
var user = Membership.GetUser(Membership.GetUserNameByEmail(ApplicantLogin.UserName));
Membership.ValidateUser(user.UserName, ApplicantLogin.Password)
Without using a switcher:
var userName = Membership.Providers["Extranet"].GetUserNameByEmail(ApplicantLogin.UserName);
var user = Membership.Providers["Extranet"].GetUser(userName, true)
Membership.Providers["Extranet"].ValidateUser(user.UserName, ApplicantLogin.Password)
where Extranet
is defined in my web config. Both examples seem to work, however, using my switcher once a user is validated and authenticated the user gets redirected to my URL defined as my DestinationPageUrl
.
Without using the switcher the user gets authenticated but is not redirected for some reason. I'm not sure why this is the case.
If I do a response.redirect after the user is validated then nothing happens either. It stays on the login page.
Any help would be appreciated.
Thanks