Overview
The Secure Link API does not require authentication for most endpoints. However, individual links can be password-protected to restrict access.There is no API-level authentication (no API keys or OAuth). Link-level password protection is optional and controlled per link.
Link Password Protection
When creating a link, you can optionally set a password to restrict access. Users attempting to resolve the link must provide the correct password.Setting a Password
Include thepassword field when creating a link:
POST /api/links
Password Storage
Passwords are securely hashed using Spring Security’sPasswordEncoder before being stored in the database. The API never stores passwords in plaintext.
Accessing Password-Protected Links
To access a password-protected link, provide the password via theX-Link-Password HTTP header.
Request Example
Header Details
The password for the protected link. Required only if the link was created with a password.
Error Responses
Missing Password
If a link requires a password but none is provided: HTTP 401 UnauthorizedInvalid Password
If the provided password is incorrect: HTTP 401 UnauthorizedSecurity Best Practices
- Use HTTPS in Production: Always use HTTPS to prevent password interception
- Strong Passwords: Use strong, unique passwords for sensitive links
- Combine with Expiration: Set both password protection and time-based expiration for maximum security
- Limit Views: Consider setting
maxViewsto limit how many times a link can be accessed
The password is validated in the service layer (ResolveLinkServiceImpl:87-94) using Spring Security’s password encoder.
Implementation Details
Controller
TheX-Link-Password header is extracted in the ResolveLinkController:
Validation Logic
Password validation occurs in the resolve flow:- Check if link is password-protected
- If yes, verify password is provided (401 if missing)
- Verify password matches hash (401 if invalid)
- Proceed with link resolution if valid
