Widevine License Request Failures: Three Layers
A Widevine licence request fails and the player shows one error. Separate the request the page built, the server answer and the CDM session that consumed it.
BotBrowser Team
Want the structured docs for Fingerprint?
This article lives in the editorial library. For step-by-step setup, reference material, and ongoing updates, jump into the docs section.
A Widevine licence failure usually reaches the reader as one line of player output, and that line rarely says which part failed. The page may never have produced a valid request, the licence server may have rejected a valid one, or the CDM may have refused a response the server considered successful. Those are three different faults with three different fixes, and the specification puts them in three different places. BotBrowser can make a CDM's presence and the surrounding browser surfaces explicit, but it does not obtain a licence, does not satisfy a rights server and cannot decrypt protected content.
The order of investigation matters more than the error text. Before the three licence layers there is a fourth check the specification makes first: whether the document is allowed to use the encrypted-media feature at all. A failure there looks similar from the player and is not a licence problem.
This article works from the W3C Encrypted Media Extensions specification and the MDN reference pages, and from no captured media. No licence response body, content key or protected sample appears anywhere in it.
TL;DR
generateRequest()builds the licence request from initialization data. If it fails, no licence server is contacted and the failure is entirely local.- The request travels to a licence server in application code. Whether that server grants rights is outside the browser and is not governed by the specification.
update()hands the licence response to the session. A well-transported response the CDM cannot parse as a licence fails here.- A successful
requestMediaKeySystemAccess()proves a key-system configuration is supported and permitted. It does not prove entitlement. - The specification requires a secure context and defines a
SecurityErrorpath when the document is not allowed to use the feature; that check precedes all three licence layers. - A session's keys stop being usable for decryption once the session closes, so a previously working flow can fail after a session was torn down.
Table of contents
- The check that comes before the licence
- Layer one: the request the page generated
- Layer two: the server answer
- Layer three: the session that consumes it
- A decision table for the three layers
- BotBrowser capability and limitation
- Practical conclusion
The check that comes before the licence
The Encrypted Media Extensions specification requires a secure context for the feature and describes a SecurityError when the calling document is not allowed to use encrypted media. That is a separate condition from anything to do with licences: it is decided before a key system is requested, let alone a licence.
The specification also documents requestMediaKeySystemAccess(), which rejects when a key system is unsupported or when none of the supplied configurations is acceptable. A reader who sees a player fail should therefore confirm two prerequisites before investigating the licence at all:
| Prerequisite | Where it is decided | What a failure here means |
|---|---|---|
| Secure context | The document's environment | The feature is unavailable regardless of licence state |
| Key-system access | requestMediaKeySystemAccess() | No configuration was acceptable; no session exists yet |
Both of those can fail while every licence component is healthy, and neither is repaired by changing a licence URL. Confirming them first prevents a licence investigation from starting on a premise that was already false.
Layer one: the request the page generated
The first licence layer is the request message. The MDN reference for generateRequest() documents the call as taking an initialization data type and the initialization data itself, and producing a message for the CDM to send to a licence server.
That description fixes what this layer can and cannot be responsible for. A failure here is local: the page did not produce a usable message. The causes are things a reader can inspect without any server involvement, such as an initialization data type the CDM does not accept, initialization data that does not match it, or a call made on a session that is already closed.
The observable signal is decisive. If generateRequest() rejects, no licence request left the browser, so a network log showing no licence traffic is confirmation rather than a separate mystery. Equally, a network log showing a licence request proves this layer succeeded, whatever happened afterwards.
That binary is worth stating plainly because it is the cheapest split available. Before interpreting any licence error, ask whether a request was sent at all. The answer divides the problem space in half.
Layer two: the server answer
Once a message exists, application code sends it to a licence server. That exchange is outside the browser's control and outside the specification entirely: the standard defines the message the CDM produces, not how a service answers it.
This layer is where the least evidence lives and the most guessing happens. A licence server can reject an unentitled account, refuse a device it does not recognize, throttle a client, or return a page instead of a licence. Several of those produce a transport success with an unhelpful body, and some produce an error status the player surfaces as a generic failure.
Two habits keep this layer honest. First, record the status and the response class separately from the licence outcome: a 200 with a rejection body and a 403 are different observations that both mean "no licence". Second, treat the server's decision as an external fact. Nothing in the browser can convert a rejected licence into a granted one, and no configuration change makes an entitlement appear.
That is also why a licence failure is a poor signal for judging a browser. The browser delivered a request; the service decided. Attributing the outcome to the client conflates two parties that the specification keeps apart.
Layer three: the session that consumes it
The third layer is update(), which delivers a licence response to the session. A response can arrive through a perfectly healthy HTTP exchange and still fail here, because transport success and licence validity are different properties.
This is the layer that produces the most misleading error text. A player may report a licence failure while the network log shows a 200, and the natural conclusion is that the log is wrong. It is not: the response arrived, and the CDM could not use it as a licence for this session.
The specification adds a constraint that matters for long sessions: each key session is associated with a single instance of initialization data from its generateRequest() call, and keys stop being usable for decryption once the session has closed. A flow that worked earlier can therefore fail later without any change to the page, the server or the licence, simply because the session that held the keys is gone.
Two checks follow. Confirm the session that receives update() is the same one that generated the request, and confirm it is still open. Both are cheap and both rule out a class of failures that looks like a server problem.
A decision table for the three layers
Each row is decided by its observation.
| Observation | Layer that failed | What it rules out |
|---|---|---|
generateRequest() rejected and no licence request appears in the network log | Request construction | Any server or session cause |
| A licence request was sent and the server answered with an error status or a refusal body | Server decision | Client construction; the request was delivered |
A 200 response arrived and update() rejected or the player failed afterwards | Session consumption | Transport; the response was delivered |
| A flow that worked before now fails, with no network change | Session lifetime | Fresh construction and server policy; the session may have closed |
The table's value is the fourth row, which the first three make possible. Once a reader can place a failure in a layer, a failure that moves layers between runs is evidence about state rather than about policy, and that distinction decides whether to re-request a licence or to re-examine the session.
Recording which row applied also keeps the next investigation short. A note such as "200 licence response, update rejected, session still open" carries the whole finding and does not require re-reading a network log to reconstruct it.
What a passing licence does not establish
It is tempting to treat a granted licence as proof that everything is healthy. It proves something narrower: this session received a response the CDM accepted as a licence for this initialization data at this moment.
It does not establish that the service would grant the same rights tomorrow, that a different device would be treated the same way, or that a long-running session will still hold usable keys. Those are separate questions with separate evidence, and the specification's session-scoped key rules are the reason they cannot be collapsed into a single pass.
Why the same error text keeps appearing across layers
Player libraries tend to funnel several internal failures into one message, because the reader-facing contract is "playback cannot start" rather than "this specific step failed". That is a reasonable product decision and a poor diagnostic one: the message is stable while the causes are not.
The practical response is to stop reading the message as a cause and start reading the sequence. Three questions, asked in order, place almost every licence failure: did generateRequest() resolve, did the licence request reach the server, and did update() resolve? Each question has an observation that answers it without ambiguity, and those observations survive a player upgrade in a way that internal error codes often do not.
That is also why a screenshot of the player is weak evidence on its own. It records the surface the library chose to show, not the step that failed. A short sequence record, taken at the same moment, is what makes the screenshot interpretable later.
Reporting the layer instead of the symptom
A useful failure report names the layer, the observation that placed the failure there, and what the investigation could not see. The last part matters most when the failure is a server decision: the browser can show that a request was delivered and what came back, but it cannot show why an account was not entitled.
That limit is worth writing down rather than working around. A report that says the update() call was reached, the server returned a rejection, and the entitlement state is not visible to the client is honest and actionable, while a report that says the DRM is broken invites a debugging effort aimed at the wrong component.
Keeping the server decision out of the client's account also keeps the client from being blamed for it. Two parties made decisions in this flow, and only one of them ran in the browser. Separating the layers is what lets a reader attribute the outcome to the party that actually decided it.
Session reuse is a decision, not a shortcut
Because a session holds the keys for its initialization data, reusing one across two different pieces of content is a claim that both share the same initialization data. When that claim is false, the failure appears at update() even though the licence server answered correctly, and it looks like a licence problem rather than a scoping mistake.
The safer pattern is one session per initialization data instance, closed when its content no longer needs it. That costs a fresh request per item, which is the price of keeping the layer boundaries intact: a request that belongs to one session cannot be misread as belonging to another.
Reuse also changes what a failure means. With one session per item, a failure at update() points at that item's response. With a shared session, the same failure can mean the wrong data, a stale session, or a genuine rejection, and separating them costs another round of investigation.
That trade is worth naming in a review. A team that reuses sessions for throughput should record the assumption it depends on, so a later failure can be checked against the assumption instead of being treated as a new mystery.
BotBrowser capability and limitation
BotBrowser documents DRM and CDM-related browser surfaces, which has a narrow role here: it keeps the client side explicit so a reader can tell which CDM ran while the three licence layers are being separated.
The limitation sits in the same paragraph. BotBrowser does not obtain a licence, does not satisfy a rights server, does not make an unentitled account entitled, and cannot decrypt protected content. The W3C Encrypted Media Extensions specification defines the message flow; the MDN Encrypted Media Extensions API page describes the interfaces a page uses; the BotBrowser DRM documentation documents the browser-side surfaces. None of them changes a service's decision.
FAQ
The network log shows a 200 but the player says the licence failed. Which is wrong?
Neither. The response arrived and the CDM could not use it as a licence for that session. Transport success and licence validity are different properties, so a 200 followed by an update() rejection is a coherent pair of observations.
Does a failing licence request mean the CDM is missing?
Not necessarily. A missing or unsupported key system fails earlier, at requestMediaKeySystemAccess(). If that call succeeded, a CDM was available and the failure belongs to one of the three licence layers.
Why did a working flow start failing with no code change?
Check the session. Keys are associated with one session and stop being usable for decryption once it closes, so a flow that reused a closed session fails in a way that looks like a fresh licence problem but is not.
Can a browser setting make the licence server grant rights?
No. The server decides, and that decision is outside the browser. A client configuration can make the environment explicit, but it cannot create an entitlement.
What should a report about this failure contain?
Which layer produced it, the observation that placed it there, and what remains unknown. A line such as "request sent, server returned an error status, entitlement state unknown" is more useful than the player's message alone.
For neighboring work, Widevine DRM setup covers making a CDM available in a profile, and Widevine CDM availability in automated browsers establishes presence and what it exposes before a licence is requested.
Sources
- W3C Encrypted Media Extensions
- MDN: MediaKeySession.generateRequest()
- MDN: Encrypted Media Extensions API
- BotBrowser DRM documentation
Practical conclusion
One licence error covers three layers and one prerequisite. Confirm the secure context and key-system access first, then ask whether a licence request left the browser: if not, the failure is local request construction. If it did, the server's answer is an external decision, and a 200 that fails afterwards is a session-consumption failure rather than a transport one. Record the layer and the observation that placed it there. A granted licence proves only that this session accepted this response now, not that a service would grant the same rights again.
This article is part of the guide: DRM Capability Checks: Key System, Robustness, Output
Related Articles
Widevine in Automated Browsers: Why EME Fails and How to Check
FingerprintDRM Fingerprinting: What EME and Widevine Queries Reveal
PlatformWidevine and Headless Browsers: The DRM Boundary Checklist
PlatformWhat Is Widevine DRM? Headless Browser Setup and Privacy
PlatformDRM Capability Checks: Key System, Robustness, Output
NetworkHeadless Browser Proxy: What Actually Changes
Run the same check in BotBrowser
Load a profile, keep the signals you just read about consistent inside the browser, and confirm the result on your own machine before a rollout.