当前位置:网站首页>Is user authentication really simple
Is user authentication really simple
2022-07-03 23:46:00 【Micro Stone】
Preface
Now you're going to build a system . Regardless of the function of the system , User authentication is always a function . Implementing it should look simple —— just “ Drag the ” Some off the shelf authentication modules , Or use some basic options ( for example Spring Security) Configure it , It's done. .
Is that right , No, it isn't . The above is a superficial description ( For example, to implement a search engine, just an input box and a search button ??), Correct identification is extremely complex . It's not just a login form -> Check the user name / password -> Set up cookie, There are many other issues to consider :
Cookie Security How to ensure cookie Will not leak or cannot be forged . Whether to use cookie, Or use JWT Such stateless methods , Use SameSite Loose or strict ?
binding IP If IP change , take cookie Bound to the IP And log off the user ?
Password requirements Minimum length 、 Special characters ? User interface to help you choose your password ?
Password storage Store passwords in the database ——bcrypt、scrypt、PBKDF2、SHA Multiple iterations ?
Password free login Allow storage in the browser , It's usually “ yes ”, But some applications deliberately hash it before sending it , Make it impossible to automatically store
Account style E-mail 、 User name and mobile number —— Do you need a user name ? Allow changes to email 、 Phone number ?

Limit login errors several times Restrict authentication attempts – How many failed login accounts should be blocked , How long should the administrator receive notification or at least record the locked account ? Every IP、 Is the limit per account a combination of these ?
Verification Code Do you need a verification code , Which one , How many attempts are allowed ? Is refreshing the verification code an option ?
Password reset Password reset token database table or with HMAC Expired Links ? Restrict password reset ?
SSO Should your service support LDAP/ActiveDirectory Authentication ( May be ), Whether it should support SAML 2.0 or OpenID Connect, If the support , Which? ? Or all ? Whether it should only support SSO, Instead of internal authentication ?
2FA – TOTP Implement the whole 2FA( Two factor certification ) technological process , Includes enabling / Ban , Or backup code ; Do not request... For a specific device for a period of time 2FA To add options ? Based on some group memberships , To configure AD/LDAP User subset Authentication ?
Force configuration 2FA Configure the mandatory settings through the administrator 2FA – Activate after global option is enabled 2FA Time window of ?
One time login Log in through the link – Whether the option of sending a one-time login link via email is supported ?
XSS Protect Make sure there is no XSS Loophole , Especially on the login page ( XSS Can steal cookie)
Authentication log Private authentication log - Keep a history of all logins , Including time 、IP、 The user agent
Force cancellation Whether you need to log off the function of the logged in device .
Allow mobile devices to remain logged in Whether to keep the mobile device logged in —— What should the client store ?( Of course not password plaintext )
Save user login address Capture the user's login time zone and store it in the session to adjust UI Time in ?
TLS Mutual authentication If we need to support token authentication using private keys , We should enable TLS Mutual authentication . What should be in the certificate Library ,Web Whether the server supports two-way per page TLS Or should we use subdomains , If there is a load balancer / Reverse proxy , Whether it supports and how to forward certificate details ?
Whether the activation step is required Need to activate the account or let the user log in immediately after registration ? Back office account approval is required ?
Initial password settings Initial password settings for the account created by the Administrator - Generate the initial password and force changes on first login ? Instead of generating a password and starting with the password reset process ?
Login exception detection How to detect login exceptions , Should users be notified by any means ? Whether to rely on third-party tools ( for example SIEM), Or built-in such functions ?
Authentication is a basic function of every application . But many developers or PM Don't pay attention to it .IT It's a complicated world , Nothing is simple . Sending email is not easy , Authentication is not easy , Logging is not simple . Handling strings and dates is not easy , Cleaning up input and output is not easy .
We're building frameworks and tools , To help us do all these things well enough . We should actively deal with these problems , Think about them and make the right plan .
边栏推荐
- "Learning notes" recursive & recursive
- C # basic knowledge (3)
- Kubedl hostnetwork: accelerating the efficiency of distributed training communication
- Gossip about redis source code 79
- Kubedl hostnetwork: accelerating the efficiency of distributed training communication
- Correlation analysis summary
- Gorilla/mux framework (RK boot): add tracing Middleware
- 股票开户佣金最低的券商有哪些大家推荐一下,手机上开户安全吗
- Pandaoxi's video
- D29:post Office (post office, translation)
猜你喜欢

MLX90614 driver, function introduction and PEC verification
![Yyds dry goods inventory [practical] simply encapsulate JS cycle with FP idea~](/img/af/1975b37d81bbdb9709ff181b9a72f9.jpg)
Yyds dry goods inventory [practical] simply encapsulate JS cycle with FP idea~

A preliminary study on the middleware of script Downloader

2022 free examination questions for hoisting machinery command and hoisting machinery command theory examination

X Opencv feature point detection and matching
![[network security] what is emergency response? What indicators should you pay attention to in emergency response?](/img/ff/c733ffbb922760910ab09af3ae2886.jpg)
[network security] what is emergency response? What indicators should you pay attention to in emergency response?

Unity shader visualizer shader graph

Current detection circuit - including op amp current scheme

Alibaba cloud container service differentiation SLO hybrid technology practice

leetcode-43. String multiplication
随机推荐
Generic tips
2/14 (regular expression, sed streaming editor)
Report on prospects and future investment recommendations of China's assisted reproductive industry, 2022-2028 Edition
Idea a method for starting multiple instances of a service
[15th issue] Tencent PCG background development internship I, II and III (OC)
Fluent learning (4) listview
Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
[network security] what is emergency response? What indicators should you pay attention to in emergency response?
Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
Deep learning ----- using NN, CNN, RNN neural network to realize MNIST data set processing
Gossip about redis source code 73
How can I get the Commission discount of stock trading account opening? Is it safe to open an account online
Yyds dry goods inventory [practical] simply encapsulate JS cycle with FP idea~
Bufferpool caching mechanism for executing SQL in MySQL
Sword finger offer day 4 (Sword finger offer 03. duplicate numbers in the array, sword finger offer 53 - I. find the number I in the sorted array, and the missing numbers in sword finger offer 53 - ii
Selenium library 4.5.0 keyword explanation (II)
URLEncoder. Encode and urldecoder Decode processing URL
How to write a good title of 10w+?
Amway by head has this project management tool to improve productivity in a straight line
IO flow principle and classification
