What is the best way to represent a login table with two types of Facebook and Conventional authentication?

4

I have an Android app and I have a standard login activity. Currently I want to add login with social networks. What is the best way to store this type of distinct logins in tables. I create a single table or partition them.

    
asked by anonymous 24.11.2014 / 01:08

2 answers

4

When I needed to do this type of login I used a very simple table to record user information.

CREATE TABLE Usuario
(
    Id INTEGER NOT NULL IDENTITY,
    PessoaId INTEGER NULL
    LoginEmail VARCHAR(200) NOT NULL,
    Senha VARCHAR(30) NULL  
)

Note that there is information that is not required ( NULL ), such as the password and the link to the Person table, where you record name, gender and other relevant information.

The biggest difficulty I had was understanding the flow of information when using this type of login ( OAuth ). In my searches I found some streams that helped me a lot and I would like to share:

Facebook

Google|Microsoft|Linkedin

Below are also the links to obtain the security privileges with the networks:

Facebook Click here

Google Click here

Microsoft Click here

Linkedin Click here

I hope I have helped.

    
25.11.2014 / 13:15
2

boy, I use it on a single table. I do not know if it is the most correct form, but as it is Login, then a table is enough! If you analyze, there will be (theoretically) only one user, for different accounts, then there will be only one line in the table for Facebook, Twitter, etc ...

I hope I have helped! =)

    
24.11.2014 / 01:13