I'm trying to implement my own implementation of GenericIdentity, but keep getting the following error when trying to load views (I use asp.net MVC):
System.Runtime.Serialization.SerializationException was unhandled
by user code Message="Type is not resolved for member
'OpenIDExtendedIdentity,Training.Web, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null'."
Source="WebDev.WebHost"
I ended up with the following class:
[Serializable]
public class OpenIDExtendedIdentity : GenericIdentity {
private string _nickName;
private int _userId;
public OpenIDExtendedIdentity(String name, string nickName, int userId)
: base(name, "OpenID") {
_nickName = nickName;
_userId = userId;
}
public string NickName {
get { return _nickName; }
}
public int UserID {
get { return _userId; }
}
}
In my Global.asax, I read the serialized cookie value in the memory stream and then used it to create my OpenIDEEXendedIdentity object. I ended this attempt at solving after countless attempts of all kinds. It works correctly until the moment when it tries to display the views.
What I'm basically trying to achieve is the ability to do the following (when using the default role manager from asp.net):
User.Identity.UserID
User.Identity.NickName
... etc.
, . Cassini, , , - , .