Click here to Skip to main content
15,881,938 members
Articles / Programming Languages / C#

Digest Authentication on a WCF REST Service

Rate me:
Please Sign up or sign in to vote.
4.95/5 (27 votes)
27 Feb 2011CPOL10 min read 157.9K   3.3K   65  
An article that explains Digest Authentication and a library to use Digest Authentication with WCF Rest and validate against any back-end.
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>8.0.30703</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{2FE50E2F-9656-4762-A5A2-C1912441CD1F}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>DigestAuthenticationOnWCFTest</RootNamespace>
    <AssemblyName>DigestAuthenticationOnWCFTest</AssemblyName>
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <TargetFrameworkProfile />
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Microsoft.ServiceModel.Web">
      <HintPath>..\External Dependencies\Microsoft.ServiceModel.Web.dll</HintPath>
    </Reference>
    <Reference Include="nunit.framework">
      <HintPath>..\External Dependencies\nunit.framework.dll</HintPath>
    </Reference>
    <Reference Include="Rhino.Mocks">
      <HintPath>..\External Dependencies\Rhino.Mocks.dll</HintPath>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.configuration" />
    <Reference Include="System.Core" />
    <Reference Include="System.ServiceModel" />
    <Reference Include="System.Web" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Base64ConverterTest.cs" />
    <Compile Include="AuthDigestEncoderTest.cs" />
    <Compile Include="DigestAuthenticationInterceptorTest.cs" />
    <Compile Include="DigestAuthenticationManagerFactory.cs" />
    <Compile Include="DigestAuthenticationManagerTest.cs" />
    <Compile Include="DigestEncodersTest.cs" />
    <Compile Include="DigestHeaderExtractorTest.cs" />
    <Compile Include="DigestHeaderStringGeneratorTest.cs" />
    <Compile Include="DigestHeaderParserTest.cs" />
    <Compile Include="DigestValidatorTest.cs" />
    <Compile Include="IPAddressExtractorTest.cs" />
    <Compile Include="KeyValueSplitterTest.cs" />
    <Compile Include="MD5EncoderTest.cs" />
    <Compile Include="MethodExtractorTest.cs" />
    <Compile Include="MockCreator.cs" />
    <Compile Include="NonceGeneratorTest.cs" />
    <Compile Include="NonceTimeStampParserTest.cs" />
    <Compile Include="NonceValidatorTest.cs" />
    <Compile Include="AuthorizationStringExtractorTest.cs" />
    <Compile Include="PrivateHashEncoderTest.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="DigestHeaderFactoryTest.cs" />
    <Compile Include="TestResources.cs" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\DigestAuthenticationOnWCF\DigestAuthenticationOnWCF.csproj">
      <Project>{454EDFB8-D743-479B-9F67-1C9E693D6594}</Project>
      <Name>DigestAuthenticationOnWCF</Name>
    </ProjectReference>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect http://www.simpletechture.nl
Netherlands Netherlands
Patrick Kalkman is a senior Software Architect with more than 20 years professional development experience. He works for SimpleTechture where he helps teams develop state of the art web applications.

Patrick enjoys writing his blog. It discusses agile software development. Patrick can be reached at patrick@simpletechture.nl.

Published Windows 8 apps:


Published Windows Phone apps:


Awards:

Best Mobile article of March 2012
Best Mobile article of June 2012

Comments and Discussions