I have an ASP MVC3 restful service that uses basic authentication. After searching stack overflow, I created the following code.
public class BasicAuthentic
Here's a sort of official sample for basic authentication:
http://www.asp.net/web-api/overview/security/authentication-filters
Another article, now using OWIN:
https://lbadri.wordpress.com/2013/07/13/basic-authentication-with-asp-net-web-api-using-owin-middleware/