Overview
Password protection adds an additional security layer to your links. When a link is password-protected, users must provide the correct password via theX-Link-Password header to access the resource.
Creating Password-Protected Links
Include thepassword parameter when creating a link:
- URL Links
- File Uploads
Passwords are hashed using BCrypt before storage. The plain-text password is never stored on the server.
Accessing Password-Protected Links
To access a password-protected link, include theX-Link-Password header in your request.
For URL Redirects
For File Downloads
Getting JSON Response Instead of Redirect
For URL redirects, you can request JSON format by setting theAccept header:
Password Validation Flow
The password authentication follows this sequence:Password required check
If the link is password-protected but no password header is provided, a 401 Unauthorized response is returned.
Password validation
The provided password is compared against the stored BCrypt hash using
PasswordEncoder.matches().Error Responses
Missing Password
When accessing a password-protected link without providing the password:Invalid Password
When providing an incorrect password:Security Implementation Details
The password protection implementation (from ResolveLinkServiceImpl:87-94):Security Features
BCrypt Password Hashing
BCrypt Password Hashing
Passwords are hashed using BCrypt, a strong adaptive hash function designed for password storage. This prevents password exposure even if the database is compromised.
Audit Logging
Audit Logging
All password attempts are logged with the result:
PASSWORD_REQUIRED- No password providedINVALID_PASSWORD- Wrong passwordSUCCESS- Correct password
Secure Header Transmission
Secure Header Transmission
The
X-Link-Password header should be transmitted over HTTPS to prevent password interception. Never send passwords over unencrypted HTTP connections in production.No Password in URL
No Password in URL
Passwords are never included in the URL or query parameters, preventing exposure in browser history, server logs, and referrer headers.
Best Practices
Password Strength
Use strong passwords with a mix of uppercase, lowercase, numbers, and special characters. Consider generating passwords programmatically for maximum security.
Recommended Practices
- Use HTTPS in production: Always transmit passwords over encrypted connections
- Generate strong passwords: Use cryptographically secure random password generators
- Communicate passwords securely: Send passwords to users through separate channels (e.g., email the link, SMS the password)
- Combine with expiration: Use both password protection and expiration for maximum security
- Monitor failed attempts: Set up alerts for excessive failed password attempts
- Rotate passwords: For long-lived links, consider periodic password rotation
Example: Secure Link Creation with All Protections
- Requires a strong password
- Expires on March 31, 2026
- Can only be downloaded 3 times
Testing Password Protection
Here’s a complete example workflow:Test with correct password (should succeed)
Next Steps
Link Expiration
Combine passwords with expiration settings
Creating Links
Learn all link creation options
Uploading Files
Password-protect file downloads
Security Metrics
Monitor password attempt patterns
