# ASP.NET Framework 4.8 video DRM integration Embed DRM-X 6.0 Universal Player in ASP.NET Framework Web Forms or existing IIS applications with authenticated server authorization and a tested async handler. Quy trình cấp quyền phát video Backend quyết định ai được xem. DRM-X cung cấp thông tin cấp quyền phát. Trình phát dùng thông tin đó để yêu cầu giấy phép DRM. - 01**Người xem** Đăng nhập vào dịch vụ của bạn và yêu cầu xem video. - 02**Backend của bạn** Kiểm tra giao dịch mua, gói đăng ký hoặc quyền xem khác của người dùng. - 03**DRM-X** Áp dụng các quy tắc đã chọn và trả về cấu hình cùng thông tin cấp quyền phát. - 04**Trình phát** Dùng thông tin cấp quyền nhận được để yêu cầu giấy phép DRM cần thiết cho việc phát video. Backend của bạn quyết định quyền truy cập; DRM-X thực thi chính sách đã ký. Nội dung đã mã hóa và giấy phép DRM được phân phối qua các đường riêng. ## Before you begin[#](#requirements) This integration targets ASP.NET Framework 4.8 and 4.8.1 on Windows and IIS, including Web Forms and existing ASP.NET applications. ASP.NET Core uses a separate sample. The Framework sample uses System.Web and does not require NuGet packages. Prepare a published Content ID and server credentials with license-tokens:create permission. Keep Site ID, Site Key and Access Key on the server. Use HTTPS for deployment and the exact public origin of your application. [Download ASP.NET Framework source](https://docs.drm-x.com/downloads/integrations/20260921.4/drm-x6-aspnet-framework-integration-example-20260921.4-5ac2f0720c16-source.zip) · [Download complete Web integration kit](https://docs.drm-x.com/downloads/integrations/20260921.4/drmx-universal-player-web-integrations-20260921.4-dcf15ad15a47.zip) ## Run the Web Forms example[#](#install) Extract the source ZIP, open the folder containing Default.aspx and Web.config, then set the environment variables below in PowerShell before starting IIS Express. For the complete kit, the folder is examples/aspnet-framework. Open http://localhost:48087/Default.aspx on the same computer. DRMX_LOCAL_DEMO=1 enables a loopback demonstration identity and authorizes only the configured VOD Content ID. Remove this switch before deployment, including deployment behind a local reverse proxy. Select the server policy in App_Code/DrmXPlayback.cs to match your encrypted package. ``` $env:DRMX_PLAYBACK_SITE_ID = "your-environment-uuid" $env:DRMX_PLAYBACK_SITE_KEY = "drmx_your-client-id" $env:DRMX_PLAYBACK_ACCESS_KEY = "drmx_secret_your-access-key" $env:DRMX_CONTENT_ID = "your-published-content-id" $env:DRMX_PUBLIC_ORIGIN = "http://localhost:48087" $env:DRMX_LOCAL_DEMO = "1" & "$env:ProgramFiles/IIS Express/iisexpress.exe" "/path:$PWD" /port:48087 /systray:false ``` ## Connect authentication and content access[#](#configure) Add App_Code/DrmXPlayback.cs and Playback.ashx to a Web Site project, or compile the C# class into your Web Application/MVC project. Merge the relevant Web.config settings with your existing application. Keep your normal authentication configuration. Set ApplicationServices.Authorize in Application_Start to query your current purchase, subscription or course records. It receives the authenticated user identifier, Content ID and content type. Reject missing, expired or revoked access. The default implementation does not authorize real customer accounts. The handler reads HttpContext.User, preferring the NameIdentifier claim and otherwise Identity.Name. Use a stable and unique identifier. Configure DRMX_PUBLIC_ORIGIN and credentials in the IIS application-pool environment, then recycle the pool after changes. ## Embed Universal Player[#](#embed) Copy the qualified script tags and Web Component from Default.aspx into your page. Keep Playback.ashx on the same origin and use an application-relative path for virtual directories. The handler checks authentication, Origin, JSON size, exact content/type and current entitlement before contacting DRM-X. ## Verification and deployment[#](#verify) Run powershell -File tests/run.ps1. The 21 service checks execute on the .NET Framework runtime with a simulated DRM-X upstream; ASP.NET precompilation also passed. IIS Express HTTP startup was blocked by access denial on the test machine, so an IIS-hosted end-to-end playback test is still required on your Windows server. Test authenticated and denied users, content substitution, access revocation, real encrypted playback and Stop. The Linux documentation server hosts this download and guide; it does not run ASP.NET Framework applications. [Integration center and downloads](https://docs.drm-x.com/vi/integrations/source-downloads) · [ASP.NET Core integration](https://docs.drm-x.com/vi/integrations/aspnet-core) · [Universal Player Web guide](https://docs.drm-x.com/vi/sdk/web) · [Universal Player SDK](https://multi-drm.drm-x.com/vi/products/sdk)