diff options
Diffstat (limited to 'src/DotNetOpenAuth.InfoCard')
6 files changed, 19 insertions, 2 deletions
diff --git a/src/DotNetOpenAuth.InfoCard/DotNetOpenAuth.InfoCard.csproj b/src/DotNetOpenAuth.InfoCard/DotNetOpenAuth.InfoCard.csproj index 09371f1..ee0899b 100644 --- a/src/DotNetOpenAuth.InfoCard/DotNetOpenAuth.InfoCard.csproj +++ b/src/DotNetOpenAuth.InfoCard/DotNetOpenAuth.InfoCard.csproj @@ -46,6 +46,15 @@ <Name>DotNetOpenAuth.Core</Name> </ProjectReference> </ItemGroup> + <ItemGroup> + <Reference Include="Validation, Version=2.0.0.0, Culture=neutral, PublicKeyToken=2fc06f0d701809a7, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\packages\Validation.2.0.0.12319\lib\portable-windows8+net40+sl5+windowsphone8\Validation.dll</HintPath> + </Reference> + </ItemGroup> + <ItemGroup> + <None Include="packages.config" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(ProjectRoot)tools\DotNetOpenAuth.targets" /> <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))\EnlistmentInfo.targets" Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), EnlistmentInfo.targets))' != '' " /> diff --git a/src/DotNetOpenAuth.InfoCard/InfoCard/Token/Token.cs b/src/DotNetOpenAuth.InfoCard/InfoCard/Token/Token.cs index 0660ec7..a87643a 100644 --- a/src/DotNetOpenAuth.InfoCard/InfoCard/Token/Token.cs +++ b/src/DotNetOpenAuth.InfoCard/InfoCard/Token/Token.cs @@ -18,6 +18,7 @@ namespace DotNetOpenAuth.InfoCard { using System.Xml; using System.Xml.XPath; using DotNetOpenAuth.Messaging; + using Validation; /// <summary> /// The decrypted token that was submitted as an Information Card. @@ -44,7 +45,7 @@ namespace DotNetOpenAuth.InfoCard { [SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times", Justification = "Not a problem for this type."), SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "False positive")] private Token(string tokenXml, Uri audience, TokenDecryptor decryptor) { Requires.NotNullOrEmpty(tokenXml, "tokenXml"); - Requires.True(decryptor != null || !IsEncrypted(tokenXml), null); + Requires.That(decryptor != null || !IsEncrypted(tokenXml), "decryptor", "Required when tokenXml is encrypted."); Contract.Ensures(this.AuthorizationContext != null); byte[] decryptedBytes; @@ -118,7 +119,7 @@ namespace DotNetOpenAuth.InfoCard { /// </summary> public string SiteSpecificId { get { - Requires.ValidState(this.Claims.ContainsKey(ClaimTypes.PPID) && !string.IsNullOrEmpty(this.Claims[ClaimTypes.PPID])); + RequiresEx.ValidState(this.Claims.ContainsKey(ClaimTypes.PPID) && !string.IsNullOrEmpty(this.Claims[ClaimTypes.PPID])); string ppidValue; ErrorUtilities.VerifyOperation(this.Claims.TryGetValue(ClaimTypes.PPID, out ppidValue) && ppidValue != null, InfoCardStrings.PpidClaimRequired); return TokenUtility.CalculateSiteSpecificID(ppidValue); diff --git a/src/DotNetOpenAuth.InfoCard/InfoCard/Token/TokenDecryptor.cs b/src/DotNetOpenAuth.InfoCard/InfoCard/Token/TokenDecryptor.cs index e9199c7..8f5697d 100644 --- a/src/DotNetOpenAuth.InfoCard/InfoCard/Token/TokenDecryptor.cs +++ b/src/DotNetOpenAuth.InfoCard/InfoCard/Token/TokenDecryptor.cs @@ -22,6 +22,7 @@ namespace DotNetOpenAuth.InfoCard { using System.ServiceModel.Security; using System.Xml; using DotNetOpenAuth.Messaging; + using Validation; /// <summary> /// A utility class for decrypting InfoCard tokens. diff --git a/src/DotNetOpenAuth.InfoCard/InfoCard/Token/TokenUtility.cs b/src/DotNetOpenAuth.InfoCard/InfoCard/Token/TokenUtility.cs index 8b9eef8..88c607a 100644 --- a/src/DotNetOpenAuth.InfoCard/InfoCard/Token/TokenUtility.cs +++ b/src/DotNetOpenAuth.InfoCard/InfoCard/Token/TokenUtility.cs @@ -27,6 +27,7 @@ namespace DotNetOpenAuth.InfoCard { using System.Text; using System.Xml; using DotNetOpenAuth.Messaging; + using Validation; /// <summary> /// Tools for reading InfoCard tokens. diff --git a/src/DotNetOpenAuth.InfoCard/InfoCardErrorUtilities.cs b/src/DotNetOpenAuth.InfoCard/InfoCardErrorUtilities.cs index cfde838..739b6e4 100644 --- a/src/DotNetOpenAuth.InfoCard/InfoCardErrorUtilities.cs +++ b/src/DotNetOpenAuth.InfoCard/InfoCardErrorUtilities.cs @@ -11,6 +11,7 @@ namespace DotNetOpenAuth { using System.Globalization; using System.Linq; using System.Text; + using Validation; /// <summary> /// Error reporting methods specific to InfoCard validation. diff --git a/src/DotNetOpenAuth.InfoCard/packages.config b/src/DotNetOpenAuth.InfoCard/packages.config new file mode 100644 index 0000000..10eec89 --- /dev/null +++ b/src/DotNetOpenAuth.InfoCard/packages.config @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="Validation" version="2.0.0.12319" targetFramework="net40" /> +</packages>
\ No newline at end of file |