title: RIA Services: How can I create custom authentication?
body: <p>I am working with the Silverlight RIA Services and I want to create custom authentication.  This appears to be the only thing that has virtually no documentation (I've read through the entire RIAServicesOverview.docx).</p>
  
  <p>Do you know of a way for me to create a customer authentication service?  I don't want to use the default ASP.NET membership model.  I don't know what interface or abstract class I need to implement - although I did find System.Web.Ria.ApplicationServices.IAuthentication.</p>
  
  <p>Do I need to implement IAuthentication?  If so, could you give me some advice on how to go about doing so?  These are the following methods:</p>
  
  <pre><code>    public User GetUser();
  
      public User Login(string userName, string password, bool isPersistent, string customData);
  
      public User Logout();
  
      public void UpdateUser(User user);
  </code></pre>
  
  <p>I don't know how I would implement any of these (except for Login) - how could the service possibly know what user is currently logged in in order for Logout() to work?</p>
  
  <p>I've been scouring the web in search of how to do this for hours, and I can't find anything that describes how to create a simple DomainService that can be used for authenticating a user in an "RIA-linked" Silverlight project.</p>
  
  <p>If someone could shed some light on this, I'd be sincerely grateful.</p>
  
  <p>Thanks, <br>
  Charles</p>
  
  <p><br>
  <strong>[EDIT]</strong><br>
  I found the <a href="http://code.msdn.microsoft.com/RiaServices" rel="noreferrer">RIA Services page on the MSDN Code Gallery</a>.  There's a section called <a href="http://code.msdn.microsoft.com/RiaServices/Release/ProjectReleases.aspx?ReleaseId=2661" rel="noreferrer">Authentication Samples</a>, which links to some great code samples. Check it out if you want to know more about how authentication works within RIA Services.</p>