{"id":43427169,"url":"https://github.com/doverunner/drm-license-token-sample-php","last_synced_at":"2026-02-25T08:30:39.491Z","repository":{"id":332887798,"uuid":"1007465001","full_name":"doverunner/drm-license-token-sample-php","owner":"doverunner","description":"Sample codes to generate DRM license token for Doverunner multi-DRM integration","archived":false,"fork":false,"pushed_at":"2026-01-19T23:08:55.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-03T06:40:20.037Z","etag":null,"topics":["drm","fairplay","php","playready","widevine","wiseplay"],"latest_commit_sha":null,"homepage":"https://doverunner.com","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doverunner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-24T03:36:36.000Z","updated_at":"2026-01-19T22:53:54.000Z","dependencies_parsed_at":"2026-02-25T08:13:37.922Z","dependency_job_id":null,"html_url":"https://github.com/doverunner/drm-license-token-sample-php","commit_stats":null,"previous_names":["doverunner/drm-license-token-sample-php"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/doverunner/drm-license-token-sample-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doverunner%2Fdrm-license-token-sample-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doverunner%2Fdrm-license-token-sample-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doverunner%2Fdrm-license-token-sample-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doverunner%2Fdrm-license-token-sample-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doverunner","download_url":"https://codeload.github.com/doverunner/drm-license-token-sample-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doverunner%2Fdrm-license-token-sample-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29815022,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T05:36:42.804Z","status":"ssl_error","status_checked_at":"2026-02-25T05:36:31.934Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["drm","fairplay","php","playready","widevine","wiseplay"],"created_at":"2026-02-02T19:08:50.210Z","updated_at":"2026-02-25T08:30:39.485Z","avatar_url":"https://github.com/doverunner.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DoveRunner Token Sample - PHP (v3.1.0)\n\n## Overview\n\nThis repository provides server-side sample code that can generate license token for DoveRunner multi-DRM service. DRM license tokens are used to authenticate license requests in multi-DRM integration workflows.\n\nHere's how a license token works in the DRM license issuance process.\n- When a multi-DRM client tries to play DRM content, the client requests a token to the content service platform to acquire DRM license. The service platform verifies that the user requesting the token has permission to the content, and then generates a token data according to the specification.\n- The service platform can set usage rights and various security policies in the token data. The generated token is delivered to the client as response.\n- When the client requests a DRM license with the token, DoveRunner cloud server validates the token and issues a license.\n\n## Documentation\n\n- [DoveRunner Docs](https://doverunner.com/docs/)\n\n\n## Environment\n- PHP Version 8.4.7 or later.\n- Install Composer to use autoloader.\n\n## Configuration\n\nBefore running the sample code, you need to configure your DoveRunner credentials.\n\n1. Copy the example configuration file:\n   ```bash\n   cp tests/config/config.php.example tests/config/config.php\n   ```\n\n2. Edit `tests/config/config.php` and fill in your credentials:\n   ```php\n   \u003c?php\n   return [\n       // DoveRunner API Credentials (required)\n       'siteId'=\u003e 'your-site-id',\n       'siteKey'=\u003e 'your-site-key',\n       'accessKey'=\u003e 'your-access-key',\n\n       // User and Content Identifiers (required)\n       'userId'=\u003e 'test-user',\n       'cid'=\u003e 'test-cid'\n   ];\n   ```\n\n3. Get your credentials from [DoveRunner Console](https://console.doverunner.com)\n\n**Note**: `config.php` is excluded from version control for security. Never commit sensitive credentials to the repository.\n\n## Quick Example\ntests/SampleTest.php\n```php\n\u003c?php\n// Require the Composer autoloader.\nrequire 'vendor/autoload.php';\n\nuse Doverunner\\Exception\\DoverunnerTokenException;\nuse Doverunner\\DoverunnerDrmTokenClient;\nuse Doverunner\\TokenBuilder;\nuse Doverunner\\PlaybackPolicyRequest;\n\n$config = include \"config/config.php\";\n\ntry{\n    // TokenClient constructor\n    $DoverunnerTokenClient = new DoverunnerDrmTokenClient();\n    \n    /* Create playback policy rule */\n    // https://doverunner.com/docs/content-security/multi-drm/license/license-token/#playback_policy\n    \n    //persistent : true / duration : 600\n    $playbackPolicyRequest = new PlaybackPolicyRequest(true, 600);\n    \n    //SecurityPolicy: SecurityPolicyRequest.php\n    //$securityPolicyRequest = new SecurityPolicyRequest(\"ALL\");\n    \n    //ExternalKey: ExternalkeyRequest.php\n    \n    /* Build rule */\n    //https://doverunner.com/docs/content-security/multi-drm/license/license-token/#token-json-format\n    $policyRequest = (new TokenBuilder)\n        -\u003eplaybackPolicy($playbackPolicyRequest)\n    //-\u003esecurityPolicy($securityPolicyRequest)\n        -\u003ebuild();\n    \n    /* Create token */\n    // siteId, accessKey, siteKey, userId, cid, policy is required.\n    // https://doverunner.com/docs/content-security/multi-drm/license/license-token/#token-json-example\n    $result = $DoverunnerTokenClient\n        -\u003eplayReady()\n        -\u003esiteId($config[\"siteId\"])\n        -\u003eaccessKey($config[\"accessKey\"])\n        -\u003esiteKey($config[\"siteKey\"])\n        -\u003euserId($config[\"userId\"])\n        -\u003ecid($config[\"cid\"])\n        -\u003epolicy($policyRequest)\n        -\u003eexecute();    \n    \n}catch (DoverunnerTokenException $e){\n    $result = $e-\u003etoString();\n}\n    echo $result;\n?\u003e\n\n\nExternalKeyRequest\n\n```\n\n## Support\n\nIf you have any questions or issues with the token sample, please create a ticket at [DoveRunner Helpdesk](https://support.doverunner.com) website.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoverunner%2Fdrm-license-token-sample-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoverunner%2Fdrm-license-token-sample-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoverunner%2Fdrm-license-token-sample-php/lists"}