Pixel Streaming Login: How to Gate a Stream Properly

Pixel Streaming Login: How to Gate a Stream Properly

A login you can walk around is decoration. How to keep the stream URL or token out of your page until a server has checked who is asking.

Rafshan TashinRafshan Tashin

December 4, 2026

6 min read

A pixel streaming login only works if the thing it guards is genuinely out of reach until someone signs in. Put the stream link in the page source and the login becomes scenery: anyone who opens View Source walks straight past it. As the documentation puts it, a login you can walk around is decoration. (Putting a login in front of a stream)

The shape of a login that holds

Five steps, and the order is the whole point:

  1. The visitor reaches your login page.
  2. Your server checks the username and password, because anything decided in the browser can be changed in the browser.
  3. On success, the server returns what starts the stream: a streaming URL for an iframe, or a fresh session token for the Web SDK.
  4. The page starts the stream by setting the iframe src or calling e3ds_controller.main().
  5. On a wrong password, the server simply says no, and the page has nothing to start a stream with.

Nothing that grants access exists in the page until the check has passed.

iframe and Web SDK protect different things

iframeWeb SDK
Received after correct loginStreaming URLSession token
Can a signed-in viewer pass it on?Yes, the URL works for anyone holding itNo, single use and expires within a minute
Streaming API keyNot usedStays on your server
Cut off one person?Only by changing the link for everyoneYes, by withholding tokens
Best forKeeping a link from people who have not signed inPer-person access that survives someone reading the source

The iframe row is the honest limitation. The link itself grants access, so your login protects it only until a signed-in viewer forwards it. Adding Password Protect Stream from the session and access settings puts a second lock on it.Keep the key off the browser

This is where Web SDK integrations go wrong. Anything in a page can be read by its visitors, and a Streaming API key left in scripts/sdk-config.js is visible through View Source and never expires. (Keeping your API key off the browser)

What that costs you is concrete: someone holding the key can start sessions billed to your account without ever touching your app or Control Panel. The warning signs are unexpected bills and your concurrent-user limit being consumed by people you cannot identify.

The fix keeps the key server-side. Your browser asks your server to stream, your server calls POST https://token.eagle3dstreaming.com/api/v2/token/create with the header Authorization: Auth <your streaming API key>, and only the token comes back to the browser. Tokens expire in about a minute and cover a single session, while a key has no expiry and no limit. OWASP's secrets management guidance makes the same case for short-lived credentials over long-lived ones.

On the browser side, only one function changes: requestSessionToken() in scripts/sdk-token.js POSTs to your own /api/streaming-token endpoint instead of calling Eagle with the key. Your main() call, callbacks, controls and markup all stay as they are.

Four mistakes to avoid

  • Copying the demo onto a public site, such as a WordPress or marketing page, which publishes the key
  • Leaving the key in sdk-config.js after copying the files
  • Judging success by whether the page works, when the real test is that the key appears in neither the page source nor the Network tab
  • Skipping the authentication check on the stream page itself, so anyone who knows its address can skip the login

Starting from the working demo

Both demos ship a login-example branch with a Node.js server needing Node 18 or later and no packages, keeping users in a JSON file:

git clone -b login-example https://github.com/e3ds/E3DS-Iframe-Demo.git
cd E3DS-Iframe-Demo
node login/server.js
# open http://localhost:3000, sign in as demo / demo123

The page POSTs { username, password } to /api/login, and on success sets streamFrame.src or calls e3ds_controller.main(). Add users with node login/add-user.js <username> <password>, and note that five wrong guesses from one address locks it out for five minutes.

Treat it as a reference, not a product. It has no sessions or cookies, so a refresh asks again; it has no password reset; the demo user must be replaced; and it must be served over https. On a real site, keep the login you already have and give it one endpoint that does what /api/login does after a successful sign-in.What this does and does not stop

It stops someone reading the source to skip the login, since neither link nor token is there until the check passes. For the Web SDK it also gives you per-person cut-off and makes token reuse pointless.

It does not stop a signed-in iframe viewer from forwarding the streaming URL, which keeps working for whoever holds it. If that matters to you, the Web SDK is the route. Our iframe vs Web SDK comparison covers the rest of the decision.

FAQs

Does a pixel streaming login protect the stream URL?

Not after sign-in. The URL keeps working for anyone it is forwarded to. (Putting a login in front of a stream)

Where should the session token be created?

On your server, using your Streaming API key, never in the browser.

How long does a session token last?

About a minute, and it covers a single session.

How do I verify my key is not exposed?

Check the page source and the Network tab. It should appear in neither.

Can I cut off one user without affecting others?

With the Web SDK, yes, by withholding their tokens.

Conclusion

A pixel streaming login is only as strong as what the page knows before sign-in. Decide on the server, hand over the URL or token afterwards, keep the Streaming API key server-side, and pick the Web SDK when access needs to be revocable per person.

Building a gated experience? Book a demo meeting or start a free trial.

Need help? support@eagle3dstreaming.com · Discord

Sources


Share this article