Problem definition: We examine a dynamic assignment problem faced by a large wireless service provider (WSP) that is a Fortune 100 company. This company manages two warranties: (i) a customer warranty that the WSP offers its customers and (ii) an original equipment manufacturer (OEM) warranty that OEMs offer the WSP. The WSP uses devices refurbished by the OEM as replacement devices, and hence their warranty operation is a closed-loop supply chain. Depending on the assignment the WSP uses, the customer and OEM warranties might become misaligned for customer-device pairs, potentially incurring a cost for the WSP. Academic/practical relevance: We identify, model, and analyze a new dynamic assignment problem that emerges in this setting called the warranty matching problem. We introduce a new class of policies, called farsighted policies, which can perform better than myopic policies. We also propose a new heuristic assignment policy, the sampling policy, which leads to a near-optimal assignment. Our model and results are motivated by a real-world problem, and our theory-guided assignment policies can be used in practice; we validate our results using data from our industrial partner. Methodology: We formulate the problem of dynamically assigning devices to customers as a discrete-time stochastic dynamic programming problem. Because this problem suffers from the curse of dimensionality, we propose and analyze a set of reasonable classes of assignment policies. Results: The performance metric that we use for a given assignment policy is the average time that a replacement device under a customer warranty is uncovered by an OEM warranty. We show that our assignment policies reduce the average uncovered time and the expected number of out-of-OEM-warranty returns by more than 75% in comparison with our industrial partner's current assignment policy. We also provide distribution-free bounds for the performance of a myopic assignment policy and of random assignment, which is a proxy for the WSP's current policy. Managerial implications: Our results indicate that, in closed-loop supply chains, being completely farsighted might be better than being completely myopic. Also, policies that are effective in balancing short-term and long-term costs can be simple and effective, as illustrated by our sampling policy. We describe how the performance of myopic and farsighted policies depend on the size and length of inventory buildup.