I recently had an interesting issue with an OData connection to SharePoint 2013. The connection that had been working perfectly stopped due to authentication failure (error 401). If I navigated to the URL in the web browser I was prompted for authentication but the credentials weren’t accepted, any other parts of the site worked perfectly OK.
To troubleshoot the problem I tried connecting to the https://sharepoint/_vti_bin/listdata.svc this failed (multiple authentication prompts) on the affected web application but worked successfully on the Central Admin site and another web application on the same server.
After much digging around a found the issue. Listdata.svc was unable to access a hidden list in the SharePoint web application. Looking in Central Admin I noticed a Farm Solution that wasn’t deployed but when I looked at the history, showed the last action as ‘deployed’. That’s odd! Anyway, I deployed the solution again and bingo, the problem was resolved.
Hopefully this helps someone else with the same problem!