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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:58:32+00:00 2026-05-16T20:58:32+00:00

I’m creating a new site and I want the users to be able to

  • 0

I’m creating a new site and I want the users to be able to use several ways to sign in, basically the users should be able to create a new user on my site OR use Facebook connect OR use Twitter’s account to log into the site.

I have seen several tutorials on using one of these methods, what I want to know is what do you think is the best approach to do this?

So far I think the best way would be to create a custom Authentication model (something like subtyping the existing authorization classes).

Is this the best approach?
Can you point me to a good example of someone trying something similar?

Thanks a lot

  • 1 1 Answer
  • 1 View
  • 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-16T20:58:32+00:00Added an answer on May 16, 2026 at 8:58 pm

    I blogged about something similar recently…Here’s the approach I took

    public class User {
        public int UserID { get; set; }
        public string Name { get; set; }
        public string Page { get; set; }
    
        public virtual Authentication Authentication { get; set; }
    }
    
    public class Authentication {
        public int Id { get; set; }
        public string LoginId { get; set; }
        public string Provider { get; set; }
        public string Password { get; set; }
    
        public virtual User User { get; set; }
    }
    
    //login methods
    User StandardUserLogin(string username) {
        IDataContext db = new DataContext();
        var user = db.Users.SingleOrDefault(u => u.Authentication.LoginId == username);
        if (user != null) {
            if (user.Authentication.Password == password) {
                SetAuthenticationTicket(user);
                return user;
            }
        }
    }
    

    I would create a different login method for each type of login depending on how their authorization schemes work.

    User OpenIdUserLogin(string username) {
        IDataContext db = new DataContext();
        var user = db.Users.SingleOrDefault(u => u.Authentication.LoginId == username && u.Authentication.Provider == "openid");
        if (user == null) {
            //create new openid user
        }
    
        if (user.Authentication.LoginId == id) {
            SetAuthenticationTicket(user);
            return user;
            }
    }
    
    //openid's authentication method
    [ValidateInput(false)]
    public ActionResult Authenticate(string returnUrl) {
        IAuthenticationResponse response = OpenId.GetResponse();
    
        if (response == null) {
            //make openid request here
        } else {
            var user = OpenIdUserLogin(response.ClaimedIdentifier);
        }
    }
    

    Btw, the two classes at the top represent my Entity Framework POCOs
    The key here is the Authentication Table which is separate from the user table. It allows one user to have multiple methods of signing in. Hope this helps you get you on track.

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

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
Basically, what I'm trying to create is a page of div tags, each has
I have a French site that I want to parse, but am running into
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I want to show the soap response to UIWebview.. my soap response is, <p><img
I want to construct a data frame in an Rcpp function, but when I

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.