Authentication
lastmod 2025-12-16created 2020-09-0549 edits
Authentication is the act of confirming or verifying something that has grounds for being true. Authenticating an object means verifying its origin, whereas authenticating a person means establishing that person's identity. Authentication may depend on one or more authentication factors.
Categories
- Security token
- Permission - Permission-related content.
- HTTP:Authentication
- C++:SecureProgramming (C++)
- Nginx:Authenticate (Nginx)
- Secure Coding (Key store)
- Hash function
- Cryptographic hash function
- Digest access authentication
- Credential Store
- License key
- Serial code
- Product key (License key) - Hints on how to generate and store product keys
- OAuth2
- Session
- Cookie
- JWT
Projects
Identity and Access Management Servers
- SuperTokens - An open-source Auth service
- Aiohttp-security (Python; aiohttp)
- Oso - An open-source Authorization/Policy engine
- PAM Duress - A separate password for emergencies
- libsecret
- Auth0
- Firebase Auth
- AWS Cognito
- Authlib - Python Authentication
- Zanzibar (Google)
- clerk - Provides sign-up/user management forms; recommended by Nomad Coders
- Stack Auth - An open-source alternative to Auth0/Clerk
- Better Auth - A comprehensive Auth framework for TypeScript
- Cerbos - A language-agnostic, scalable user permission management solution
- OpenAUTH - A standards-based authentication provider for web and mobile apps
- Keycloak
- Cryptlex
- LimeLM (by LimeSoftware)
- LicenseSpring
- Open License Manager (OLM)
- LicenseManager
- Tesseral - An open-source B2B SaaS authentication infrastructure platform
Access Control
Libraries
Secret Management
Server authentication made easy
Server/client authentication and password storage
- [Recommended] NAVER D2 - Secure password storage 4
- How to store passwords securely on a server (Node.js + MongoDB) - bcrypt
- node.js password security (Security Password) - md5, sha256, pbkdf2
- security - Storing passwords securely but determining identical passwords
- [Recommended] PBKDF2 strong salt for client-side hashing
First, make sure you read this answer to the question "Client side password hashing", paying particular attention to the last paragraph.
Also, please realize that client side javascript is going to be incredibly slow at PBKDF2 compared to good server side code. At least try to find a PBKDF2 implementation that uses HMAC-SHA-512 as a base.
That said, if you want to give the user peace of mind, that's fine; do the following:
- Client side PBKDF2 hashing for a known, "high" iteration count.
- Double bonus points if the user is allowed to select the iteration count themselves!
- I put high in quotes because I doubt your javascript code's going to be fast enough to do tens or hundreds of thousands of iterations in the time you can get enough of your user base to accept, particularly on cheaper mobile devices.
- A good hash of the username and password as a salt isn't great, though it's better if your code pads the username out to the maximum possible length and puts it first.
- That way, "user1" and "password" don't make the same salt as "user" and "1password"!
- There is, of course, no maximum length on the password except what's caused by your back end software; SQL Server, for instance, has an 8000 byte maximum on "less inefficient" string work.
- which then DOES generate a cryptographically random salt of 12-16 bytes
- and then uses PBKDF2 with a much higher iteration count to hash the hash passed in
- again hopefully HMAC-SHA-512 for the 64 bit operations to lessen the proportionate advantage of offline GPU attacks.
- because then someone who gets your leaked password database still has to do the work of an attack against a password hashing function to log in, rather than simply sending the client-generated hash they stole and having it be accepted as-is.
Remember with PBKDF2 password hashing in particular, never ask for an output size larger than the native base hash's output size. Smaller is all right if you're really, really concerned about storage; for instance, requesting only 32 bytes of PBKDF2-HMAC-SHA-512's native 64 byte output.
- 20 bytes for SHA-1
- 32 bytes for SHA-256
- 64 bytes for SHA-512
Client side password hashing
Hashing on the client side doesn't solve the main problem password hashing is intended to solve - what happens if an attacker gains access to the hashed passwords database. Since the (hashed) passwords sent by the clients are stored as-is in the database, such an attacker can impersonate all users by sending the server the hashed passwords from the database as-is.
On the other hand, hashing on the client side is nice in that it ensures the user that the server has no knowledge of the password - which is useful if the user uses the same password for multiple services (as most users do).
A possible solution for this is hashing both on the client side and on the server side. You can still offload the heavy PBKDF2 operation to the client and do a single hash operation (on the client side PBKDF2 hashed password) on the server side. The PBKDF2 in the client will prevent dictionary attacks and the single hash operation on the server side will prevent using the hashed passwords from a stolen database as is.
See also
Favorite site
References
- Access control
- Aiohttp-security
- Attribute-based access control
- Auth.js
- Bcrypt
- Better Auth
- C++:SecureProgramming
- Cerbos
- Cryptlex
- Cryptographic hash function
- Digest access authentication
- GoTrue
- Hash function
- Have I Been Pwned
- HTTP:Authentication
- Information security
- JavaScript:Libraries
- LicenseManager
- LicenseSpring
- LimeLM
- Open License Manager
- OpenAUTH
- OpenID
- Oso
- PAM Duress
- Passkey
- Pbkdf2
- Permission
- Product key
- Proof of work
- PyJWT
- Python:hashlib
- Python:Libraries
- Role-based access control
- Salt
- Secure Coding
- Security token
- Serial code
- Session
- Software as a Service
- Supabase:JWTSigningKeys
- SuperTokens
- Tesseral
- Threat (computer security)
- WebAuthn
- Zanzibar
- Zip bomb