The UserBase is very IPrincipal and IIdentity oriented, so it holds name and roles and not much else. The UserBase class is DevForce's IPrincipal implementation for Silverlight, but you can extend it fairly easily to do what you need. As you mention you will also need to subclass the AspAuthenticatingLoginManager. Alternatively, and harder, you could write your own ILoginManager and IPrincipal implementations. Here's a sample of what you can do to stick the UserID into the custom UserBase so that it's available on the Silverlight client, as well as any server-side DevForce code your write.
// In CustomUser.cs in a server project, and shared in an SL project:
[DataContract]
public class CustomUser : UserBase, IKnownType {
public CustomUser(IIdentity identity, IEnumerable<string> roles) :
base(identity, roles) { }
[DataMember]
public Guid UserID { get; set; }
}
// In CustomLoginManager.cs in a server project:
public class CustomLoginManager : AspAuthenticatingLoginManager {
protected override IPrincipal CreateUserCore(string name, bool isAuthenticated, IEnumerable<string> roles) {
var user = base.CreateUserCore(name, isAuthenticated, roles) as CustomUser;
user.UserID = (Guid)Membership.GetUser(name).ProviderUserKey;
return user;
}
}
Before this week we actually hadn't had any requests for the UserID. We will look at incorporating this so that you don't need to write custom code.