Search code examples
authenticationravendbextend

Extending RavenDB AuthenticationUser


I am currently trying to implement Authentication using the RavenDB Authentication Bundle and the Facebook C# SDK in MVC 3. I have everything working to date except for persisting all of the information provided by the Facebook Graph API (such as the facebookId and the accesstoken).

One possible (albeit ugly) solution is to create a separate facebook document model for this information and manage both the AuthenticationUser and the facebook model when performing any actions against the user.

I was wondering, however, if there might be a more elegant way to handle this extra data and incorporate it into the AuthenticationUser document by possibly extending it somehow? Any suggestions would be greatly appreciated. Thanks in advance.


Solution

  • The easiest would be to inherit from AuthorizationUser and add anything you want. You can also NOT inherit from it, as long it has has the same shape (expected properties match)