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 9069007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:19:10+00:00 2026-06-16T17:19:10+00:00

In my first project going real DDD, I’m stuck with some doubts concerning which

  • 0

In my first project going real DDD, I’m stuck with some doubts concerning which course to take in this scenario…

I have a distributed architecture, in which users of several applications will have only one account that will make them able to authenticate. This account can be created on our own system, or the user can share with us his login with facebook, google and other third-party account provider.

So, there’s a project for only this purpose, control user accounts.

This scenario made me came with this approach within my model (simplified):

public class User
{
    public User(string name)
    {
        Id = Guid.NewGuid();
        Name = name;
    }

    public Guid Id { get; protected set; }

    public string Name { get; protected set; }
}

public abstract class Account
{
    protected Account(User user)
    {
        Id = Guid.NewGuid();
        User = user;
    }

    public Guid Id { get; protected set; }

    public User User { get; protected set; }
}

public class MySystemAccount : Account
{
    public MySystemAccount(string email, string password, User user)
        : base(user)
    {
        Email = email;
        Password = password;
    }

    public string Email { get; protected set; }

    public string Password { get; protected set; }
}

public class FacebookAccount : Account
{
    public FacebookAccount(string facebookId, User user)
        : base(user)
    {
        FacebookId = facebookId;
    }

    public string FacebookId { get; protected set; }
}

The thing is that the other applications will access this project via REST services.

So, I thought about a single /Authenticate service that will provide a json with dynamic form. It could de a json with a email/password, or a json with the facebookId.

But then, how can I connect the layers?

I thought about making an application service, but I got stuck on who and how should decide what is going on, what should my rest service communicate to the application and how the application will know to do the thing, whatever kind of authentication it is, an user from my own domain or a user from facebook and so on..

Any thoughts on this?

Thanks!

  • 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-06-16T17:19:11+00:00Added an answer on June 16, 2026 at 5:19 pm

    This seems to be a multi-part question – one part about the object model and polymorphism and another about architecture.

    Regarding the object model, the use of inheritance isn’t ideal in this scenario. Each sub-type of Account won’t really have much specific behavior or any behavior at all. The only specialization is the presence of different data fields. Additionally, use of inheritance will complicate persistence.

    Architecturally, what I think you’re trying to achieve is federated identity. This basically decouples the notion of a user (an identity) from the authentication process. In turn, this allows all remaining application code to bypass authentication concerns and depend only on the user’s identity. Take a look at OpenID as well as the DotNetOpenAuth library which provides an OpenID implementation in C#.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a little Android project going on which involves some IPC where client
The project which I am going to start is my first project and it
This is my first iPhone project and all has been going very well but
I'm working on my first PHP project, and it's going well. I've been able
I'm working on my first project in which I'm utilizing PHPUnit for unit testing.
this is my first python project. I am having issues setting up a project
I'm still just getting into MVC, and for my first real project I plan
I'm working on my first 'real' (as opposed to playing around) rails 3 project
I'm attempting to create my first real C# application - a small pet project
This is my first WPF project. I'm trying to get a rolling credits effect

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.