I am looking for some code to log in a user into public views from a custom page within the public view site.
This is pretty easy, in that you should be able to use:
ValidateUser from the MembershipWebService.asmx Web Service, and be all set.
However, I have a bit of a twist. I have an ID number and do not have the user's password. I can get the record's username, but I have not way of knowing the password.
Anyone know of a method that will allow this process?
I see that in iBO I can create a CContact using -> CContactUser.LoginByWebLogin(UserName) but
I don't think there is an equivlent method to get a CWebUser without a password.
I also don't see any method in MembershipWebService that would do it.
I think I can still make this happen, but it is a pretty convoluted method involving storing the hash and salt, resetting the password, logging in, and then setting the hash and salt back.
This is obvously not ideal.
Thoughts?
Jason
will LoginByPrincipal do what you need?
i.e.
Asi.iBO.ContactManagement.CContactUser cContactUser1 = Asi.iBO.ContactManagement.CContactUser.LoginByWebLogin("username");
Asi.iBO.ContentManagement.CWebUser cWebUser1 = Asi.iBO.ContentManagement.CWebUser.LoginByPrincipal(AppContext.CurrentPrincipal);