Csla.Security.MembershipIdentity Example

Csla.Security.MembershipIdentity Example

Old forum URL: forums.lhotka.net/forums/t/6445.aspx


MTmace posted on Tuesday, February 17, 2009

Does anyone have an example of this?
Do I need to create a Principle, Identity and Provider?

I want to use the aspnetdb. I was thinking there was a way to use the SqlMembershipProvider model and somehow pass the identity to the CSLA.ApplicationContext.

Curelom replied on Tuesday, February 17, 2009

pg 645 in the Expert c# 2008 book. I just did this earlier today. In the Authenticate method of the asp logincontrol I call the login of the csla custom principal class like this and it works.

protected void LoginControl_Authenticate(object sender, AuthenticateEventArgs e) {
MyPrincipal p = MyLibrary.Security.MyPrincipal.Login(LoginControl.UserName, LoginControl.Password);
e.Authenticated = p.Identity.IsAuthenticated;
}

MTmace replied on Tuesday, February 17, 2009

Thanks, that is the piece I was missing.

Copyright (c) Marimer LLC