On this page
Deciding whether a URL should require login starts with the resource, not the URL’s appearance. A public help page and a customer invoice may both have ordinary-looking links, but they need different access rules. This guide helps product teams choose between public access, signed-in access, and controlled sharing—and check that the choice works.
Key Takeaways
- Make a resource public only when anyone may view it, copy it, and share it.
- Require sign-in and check permissions when access depends on who the visitor is.
- A share link can grant limited access without sign-in, but anyone who obtains a bearer link may be able to use it.
- An obscure path, an unlisted page, or a search-engine exclusion is not authorization.
- Test access after permissions change, not just when a link is first created.
Choose an access model
| Model | Suitable for | Main trade-off |
|---|---|---|
| Public page | Published documentation, marketing pages, and other content intended for everyone | Anyone can copy or redistribute the content. |
| Sign-in plus authorization | Customer records, internal documents, and resources limited to specific people or organizations | Visitors need an account and appropriate permissions; the product must manage access changes. |
| Share link with explicit controls | A document shared with an external collaborator or a time-limited preview | A bearer link is convenient but can be forwarded or exposed. Recipient-specific sign-in is safer when identity matters. |
Ask these questions before selecting a model:
- Would disclosure to an unintended person cause harm or violate an obligation? If so, do not make the resource public. Consider contractual, privacy, and regulatory requirements as well as user expectations.
- Must access be limited to named people or members of an organization? Require sign-in and check the visitor’s current permission for that specific resource.
- Is it acceptable for anyone holding the link to view the resource? If yes, a limited bearer share link may be appropriate. If not, use recipient-specific access with sign-in.
- Does access need to end? Define who can revoke it, when it expires, and what happens to existing sessions and already downloaded copies.
When in doubt, start with restricted access and provide an intentional sharing option. Changing a published resource back to private cannot reliably recover copies already made.
Advertisement
Why a hidden URL is not authorization
A long, hard-to-guess path can make discovery less likely, but it does not establish who is permitted to view the content. URLs can be copied into messages, browser history, logs, analytics systems, or support tickets. They may also be forwarded accidentally.
Similarly, removing a page from navigation or asking search engines not to index it does not prevent a direct request. A public resource remains public if the server returns its content to anyone who requests it.
A bearer share link is different from an accidentally obscure public URL: it deliberately carries a secret token that acts as a credential. That token can support an access policy, but it does not prove the holder’s identity. Treat the link as sensitive and assume it can be reused by someone other than the intended recipient.
Design sign-in and sharing controls
Authenticated resources
For a restricted resource, sign-in identifies the visitor; authorization determines whether that visitor may perform the requested action. Check both on the server for each protected request, including requests for attachments, downloads, API responses, and previews. Being signed in alone should not grant access to every resource.
Define permissions at the appropriate level: for example, a named user may view one document but not edit it, or a current organization member may view records belonging to that organization. When membership or a resource grant is removed, subsequent requests should no longer succeed, even if the visitor still has a valid session.
A signed-out visitor can be directed to sign in. A signed-in visitor without permission should be denied. Decide whether the response may reveal that a resource exists; in sensitive contexts, avoid exposing unnecessary details through error messages.
Controlled share links
Choose a sharing mode explicitly:
- Recipient-specific sharing: Invite named users and require them to sign in. Check their current permission when they open the resource.
- Bearer-link sharing: Allow anyone holding the link to access the specified resource. Use a strong, unguessable token and scope the link to the minimum necessary action, such as view-only access to one document.
For either mode, make the sharing status visible to the owner and provide a way to revoke access. For bearer links, consider an expiration time and generate a new token when replacing a compromised link. Clearly explain that forwarding the link may grant access to the recipient’s contacts too.
Reduce accidental token exposure: avoid putting full share URLs in logs or analytics, use HTTPS, and review how pages handle referrer information and third-party resources. These precautions reduce exposure; they do not prevent a recipient from copying the content or the link.
Advertisement
Test the decision before launch
Use a non-sensitive test resource and separate test accounts. Run these checks against the deployed application, including any download endpoints and caching layers.
| Test | Steps | Expected result |
|---|---|---|
| Signed-out visitor | Open a restricted resource in a fresh private browser session. | The visitor sees a sign-in prompt or denial, not the protected content or attachment. |
| Wrong account | Sign in as a user without a grant and open the same URL. | Access is denied, even though the user is authenticated. |
| Revoked account access | Open the resource as an authorized user, remove that user’s permission, then request it again using the existing session. | Subsequent requests are denied according to the access policy. |
| Revoked share link | Create a share link, confirm its intended access, revoke it, and retry it in a fresh session. | The revoked link no longer grants access. |
| Accidental forwarding | Give a test share link to a second, unintended test user. | A bearer link may work for that user; a recipient-specific link should not grant access unless that user is authorized. |
| Expired link | Open a link after its configured expiry. | Access is denied; the owner can issue a new link if appropriate. |
| Cached or alternate response | After revocation, retry the page, API request, preview, and download through the normal delivery path. | Protected content is not returned by an alternate endpoint or shared cache. |
These tests check future access, not recall of content already downloaded, copied, or captured. If immediate revocation is important, verify how sessions, caches, and any temporary download links behave in your specific platform.
Common Mistakes
- Treating sign-in as permission. An authenticated user may still lack access to a particular resource.
- Calling a bearer link private without explaining forwarding. Anyone who gets the link may be able to use it until it expires or is revoked.
- Protecting only the page. The underlying API, file, thumbnail, or cached response may still expose the resource.
- Assuming revocation deletes copies. Access controls cannot reliably retract content already saved by a recipient.
- Using an unlisted or no-index page for confidential data. Neither choice blocks direct access.
Best Practices
Document the intended audience, allowed actions, owner, expiration, and revocation process for each resource type. Prefer recipient-specific access when the identity of the viewer matters, and make public or bearer-link sharing an explicit product choice. Check permissions at the server and configure caches so they cannot return one user’s protected content to another.
This guide uses general access-control principles. Authoritative authentication guidance and platform-specific documentation could not be consulted in this environment; verify your chosen platform’s current sharing, session, and caching behavior before implementation.
Conclusion
A URL should require login when access depends on the visitor’s identity. Use public access only for content intended for everyone, and use controlled share links only when their scope and forwarding risks match the resource.
What would your domain sell for?
A free TidyURLs account unlocks the Domain Estimator. It prices a name from 191,011 real domain sales.