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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:57:03+00:00 2026-06-11T04:57:03+00:00

my website enables two ways to login (similar to many websites including stackoverflow). register

  • 0

my website enables two ways to login (similar to many websites including stackoverflow).

  1. register your email and password and login afterward.
  2. Login with Facebook connect

so I got a User class (I’m using Ebean [JPA]).
when a user logged in with facebook connect I extract basic information using facebook Graph API.

now, should I differentiate (in the DB level) between the two types of users? (for example, creating separate table for FacebookUser. I heard also about table inheriting. is it feet my situation?)

what is the best practice for this two types of login options?
I should mention that I’d like in the near future using Google account as a way to login.

  • 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-11T04:57:05+00:00Added an answer on June 11, 2026 at 4:57 am

    I suggest you use a users table that contains basic information about your users, regardless of registration mechanics (below it’s a barebones example):

    id | name | email | date_created

    Different services will have different auth methods, so maybe it’s a good idea to have different tables for each:

    auth_facebook:

    id | facebook_id | access_token | …

    auth_website:

    id | password | …

    And so on. Usually, the ability to login using multiple services is there for convenience, you probably would want to centralize your users one way or another. It’s also good to keep in mind that with regards to authentication, you’ll have your primary id in the users table, but you’ll have different validation methods depending on the service the user uses to connect. For Facebook, you can check against the facebook_id after auth and see which of your users logged in. The schema above would allow you to offer users to connect other services too, which can be helpful.

    A specific case would be if you have basic profiles for people, but you want to allow them to show off their GitHub repos, SO rep and allow them to connect with Facebook friends at the same time.

    Table inheritance sounds like overkill and most likely different implementation in different database systems. A view of all these tables could be more suitable.

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

Sidebar

Related Questions

I am implementing a JavaScript function that enables/disables two CSS file of a website:
I have two websites: one with Lighttpd with PHP and second with Apache and
I have two variations in my website color and size. I have added it
I have two IIS websites, namely accounts.example.com that was created in Visual Studio 2010
i am using facebook javascript SDK for login button in my website it is
I am developing a website that has two back to back web broadcasts. I
Imagine these two chunks of code residing in htaccess for speeding up the website.
I am trying to host two websites using Apache from the same Ubuntu server.
We have two websites one for mobile and one to be accessed from PC.
Typically, I inject so many javascript in the website. But suddenly, the client told

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.