Skip to content


Subversion checkout URL

You can clone with
Download ZIP
branch: dev
Fetching contributors…

Cannot retrieve contributors at this time

26 lines (20 sloc) 0.78 kb
using System.Net.Http;
using System.Security.Principal;
using System.Threading;
using System.Threading.Tasks;
using WebApiDoodle.Web.MessageHandlers;
namespace PingYourPackage.API.MessageHandlers {
public class PingYourPackageAuthHandler :
BasicAuthenticationHandler {
protected override Task<IPrincipal> AuthenticateUserAsync(
HttpRequestMessage request,
string username,
string password,
CancellationToken cancellationToken) {
var membershipService = request.GetMembershipService();
var validUserCtx = membershipService
.ValidateUser(username, password);
return Task.FromResult(validUserCtx.Principal);
Jump to Line
Something went wrong with that request. Please try again.