summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Test/OpenId/Messages/CheckAuthenticationRequestTests.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2010-06-08 22:38:46 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2010-06-08 22:38:46 -0700
commitc604f25eaf5cd4fce2a73e00bfe8b27fe97b86d0 (patch)
treee37f874cfe3a0937059e4acf1090254ce0b3dba6 /src/DotNetOpenAuth.Test/OpenId/Messages/CheckAuthenticationRequestTests.cs
parentb3a35b9ae0823dda35bb07b404c9c09fec09402a (diff)
parent436da522dcab28df4e19b212b49270c5211ff92b (diff)
downloadDotNetOpenAuth-c604f25eaf5cd4fce2a73e00bfe8b27fe97b86d0.zip
DotNetOpenAuth-c604f25eaf5cd4fce2a73e00bfe8b27fe97b86d0.tar.gz
DotNetOpenAuth-c604f25eaf5cd4fce2a73e00bfe8b27fe97b86d0.tar.bz2
Merge branch 'v3.4' into oauth2
Conflicts: src/DotNetOpenAuth/Configuration/MessagingElement.cs src/DotNetOpenAuth/Messaging/Reflection/MessagePart.cs
Diffstat (limited to 'src/DotNetOpenAuth.Test/OpenId/Messages/CheckAuthenticationRequestTests.cs')
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/Messages/CheckAuthenticationRequestTests.cs31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/DotNetOpenAuth.Test/OpenId/Messages/CheckAuthenticationRequestTests.cs b/src/DotNetOpenAuth.Test/OpenId/Messages/CheckAuthenticationRequestTests.cs
index cf6b814..d2d2cc4 100644
--- a/src/DotNetOpenAuth.Test/OpenId/Messages/CheckAuthenticationRequestTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/Messages/CheckAuthenticationRequestTests.cs
@@ -6,12 +6,37 @@
namespace DotNetOpenAuth.Test.OpenId.Messages {
using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
+ using DotNetOpenAuth.OpenId;
+ using DotNetOpenAuth.OpenId.Messages;
using NUnit.Framework;
[TestFixture]
public class CheckAuthenticationRequestTests : OpenIdTestBase {
+ /// <summary>
+ /// Verifies that the check_auth request is sent preserving EXACTLY (non-normalized)
+ /// what is in the positive assertion.
+ /// </summary>
+ /// <remarks>
+ /// This is very important because any normalization
+ /// (like changing https://host:443/ to https://host/) in the message will invalidate the signature
+ /// and cause the authentication to inappropriately fail.
+ /// Designed to verify fix to Trac #198.
+ /// </remarks>
+ [TestCase]
+ public void ExactPositiveAssertionPreservation() {
+ var rp = CreateRelyingParty(true);
+
+ // Initialize the positive assertion response with some data that is NOT in normalized form.
+ var positiveAssertion = new PositiveAssertionResponse(Protocol.Default.Version, RPUri)
+ {
+ ClaimedIdentifier = "https://HOST:443/a",
+ ProviderEndpoint = new Uri("https://anotherHOST:443/b"),
+ };
+
+ var checkAuth = new CheckAuthenticationRequest(positiveAssertion, rp.Channel);
+ var actual = rp.Channel.MessageDescriptions.GetAccessor(checkAuth);
+ Assert.AreEqual("https://HOST:443/a", actual["openid.claimed_id"]);
+ Assert.AreEqual("https://anotherHOST:443/b", actual["openid.op_endpoint"]);
+ }
}
}