Hello,
I assume MembershipUser object and object implementing IPrincipal interface are “connected” in a sense that when certain information in one of the objects changes, the other object is also changed appropriately?
thanx for helping
Hello,
I assume MembershipUser object and object implementing IPrincipal interface are “connected” in a sense that when certain information in one of the objects changes, the other object is also changed appropriately?
thanx for helping
Not sure whether or not I understand your question here but I believe your assumption is incorrect.
MembershipUser is used by System.Web.Security to authenticate a User via the MembershipProvider to you have set in you web config. When you call...
MembershipUser user = Membership.GetUser(username);
Your membership provider will query the datastore where you keep your user information (A Sql Database, Active Directory, etc..) and return back the Memberhsip data sotred for that username.
If you have defined another class in your application that implements the IPrincipal interface and you have instantiated an object of that type, that does not necessarily mean that your MembershipUser object and your custom object share data (unless of course you have assigned the reference programatically )
Maybe if you provided a code example it would help clarify
I don`t know why do you use 2 classes for members authentification. Under my oppinion , every web developer must to develop a personal class which to use the database ,to encrypt passwords (using MD5 , SHA )