Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 311717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:57:01+00:00 2026-05-12T07:57:01+00:00

I am working with the Silverlight RIA Services and I want to create custom

  • 0

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).

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.

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:

    public User GetUser();

    public User Login(string userName, string password, bool isPersistent, string customData);

    public User Logout();

    public void UpdateUser(User user);

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?

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.

If someone could shed some light on this, I’d be sincerely grateful.

Thanks,
Charles

[EDIT]
I found the RIA Services page on the MSDN Code Gallery. There’s a section called Authentication Samples, which links to some great code samples. Check it out if you want to know more about how authentication works within RIA Services.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T07:57:02+00:00Added an answer on May 12, 2026 at 7:57 am

    If you create a “Silverlight Business Application” you’ll see how the template implements authentication. (Or just go here and download the template sample project.)

    To simplify, here’s the process I used:

    First, I create a domain service (FooService) that derives from LinqToEntitiesDomainService where FooContext is my entity model. In it I add all the CRUD operations to access my custom DB table and return user profiles.

    Next, create a concrete User class on the serverside by deriving from UserBase:

    using System.Web.Ria;
    using System.Web.Ria.ApplicationServices;
    
    public class User : UserBase
    {}
    

    Finally, derive a class from AuthenticationBase and implement the following four methods:

    [EnableClientAccess]
    public class AuthenticationService : AuthenticationBase<User>
    {
        private FooService _service = new FooService();
    
        protected override bool ValidateUser(string username, string password)
        {
            // Code here that tests only if the password is valid for the given
            // username using your custom DB calls via the domain service you
            // implemented above
        }
    
        protected override User GetAuthenticatedUser(IPrincipal pricipal)
        {
            // principal.Identity.Name will be the username for the user
            // you're trying to authenticate. Here's one way to implement
            // this:
            User user = null;
            if (this._service.DoesUserExist(principal.Identity.Name)) // DoesUserExist() is a call
                                                                      // added in my domain service
            {
                // UserProfile is an entity in my DB
                UserProfile profile = this._service.GetUserProfile(principal.Identity.Name);
                user.Name = profile.UserName;
                user.AuthenticationType = principal.Identity.AuthenticationType;
            }
            return user;
        }
    
        public override void Initialize(DomainServiceContext context)
        {
            this._service.Initialize(context);
            base.Initialize(context);
        }
    
        protected override void Dispose(bool disposing)
        {
            if (disposing)
                this._service.Dispose();
            base.Dispose(disposing);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First time poster. I'm using MVVM-Light with Silverlight 4 and RIA Services. This has
I'm working on a Silverlight app that has an UnhandledException handler in the App
I'm working on a Silverlight 3 app with RIA Services. I've got the app
I am working on a Silverlight application that has a Form that is supposed
I am working with a Silverlight business application that is using Windows Authentication. When
I am working on a Silverlight web application that creates PDF documents. We want
I am working on a Silverlight application using RIA services with Entities Framework. Forgive
I'm working with Azure Storage Tables and RIA services to create a, rather basic,
I have developed a silverlight application with WCF-RIA services and is working fine. I
I am new to Silverlight RIA services and I have a basic working prototype

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.