Design of a third-party login Registration database table

Source: Internet
Author: User

Register Database Design

1. Previous

Id
Username
Password

......

Username plus password, address simple requirements, leave an ID as a foreign key to other tables. Of course, then the password may also be plaintext storage, better know MD5.

2. Later

ID//PRIMARY key
Username//Account
Password//password
Name//Nickname
Phone//Telephone
Email//Email
Realname//real name
Sex//gender
Ages//Age
Qq
Address//Addresses
HEAD_IMG//Avatar Address
Rights//Permissions
Status//Account state
Register_time//Registration time
REGISTER_IP//Registered Address
Login_time//Login time
LOGIN_IP//Login Address

......

With the expansion of business needs, to add a user state status to determine whether the user is banned, registration time and registered IP address, last login time and IP address for reference (and derived from the login record table, used to determine whether remote login, etc.), user Role/Permissions rights (also derived from the user role permission relationship, or another discussion), the business also requires personal information such as real name, address and so on a brain to add, and now form a very complete user relationship table.

3. Web2.0 era

In the Web2.0 era, Weibo has opened third-party websites.
Later it was a variety of third-party website Login.

User base Information table users
Id
Nickname
Avatar

......
User authorization Information Sheet user_auths
Id
user_id
Identity_type Login type (mobile phone number, email username) or third party app name (Weibo, etc.)
Identifier identification (mobile phone number mailbox user name or third party app's unique identity)
Credential Password voucher (store password within the station, do not save or save tokens outside the station)

......

Design of a third-party login Registration database table

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.