Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Authenticate MembershipUser without password?

Is it possible to authenticate a MembershipUser without a password. I have gues user accounts and whihc have temporary passwords, however i do not required these users to actually login. I want to automatically authenticate them back on their userid.

Can this be done?

FormsAuthentication.SetAuthCookie(publicuser.UserName, false); 

doesn't seem to actually authenticate them againsts the memebrship provider.

like image 983
Nugs Avatar asked Nov 20 '25 18:11

Nugs


1 Answers

You can override the ValidateUser defined in System.ServiceModel.DomainServices.Server.ApplicationServices:

protected override bool ValidateUser(string userName, string password)

Then you can check

if ( IsAGuestAccount( userName ) ) return true;

like image 188
DanTheMan Avatar answered Nov 22 '25 07:11

DanTheMan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!