summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Test/OAuth/ChannelElements/SigningBindingElementBaseTests.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-04-30 22:23:29 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2009-04-30 23:28:10 -0700
commit08b82b6108b179762fd30485382814ee6ffffaa0 (patch)
tree635d0758a89c97065552ce188c7f81b077f5142e /src/DotNetOpenAuth.Test/OAuth/ChannelElements/SigningBindingElementBaseTests.cs
parentc946714b6bd210fdba1afc68daa77aa972f765e9 (diff)
downloadDotNetOpenAuth-08b82b6108b179762fd30485382814ee6ffffaa0.zip
DotNetOpenAuth-08b82b6108b179762fd30485382814ee6ffffaa0.tar.gz
DotNetOpenAuth-08b82b6108b179762fd30485382814ee6ffffaa0.tar.bz2
Added more tests to verify correct behavior of OAuth Authorization header and message parts in different places.
Fixed a bug in the signature construction process the test found.
Diffstat (limited to 'src/DotNetOpenAuth.Test/OAuth/ChannelElements/SigningBindingElementBaseTests.cs')
-rw-r--r--src/DotNetOpenAuth.Test/OAuth/ChannelElements/SigningBindingElementBaseTests.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.Test/OAuth/ChannelElements/SigningBindingElementBaseTests.cs b/src/DotNetOpenAuth.Test/OAuth/ChannelElements/SigningBindingElementBaseTests.cs
index cff46af..93c0b3f 100644
--- a/src/DotNetOpenAuth.Test/OAuth/ChannelElements/SigningBindingElementBaseTests.cs
+++ b/src/DotNetOpenAuth.Test/OAuth/ChannelElements/SigningBindingElementBaseTests.cs
@@ -50,6 +50,15 @@ namespace DotNetOpenAuth.Test.ChannelElements {
Assert.AreEqual(
"GET&https%3A%2F%2Fwww.google.com%2Faccounts%2FOAuthGetRequestToken&oauth_consumer_key%3Dnerdbank.org%26oauth_nonce%3Dfe4045a3f0efdd1e019fa8f8ae3f5c38%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1222665749%26oauth_version%3D1.0%26scope%3Dhttp%253A%252F%252Fwww.google.com%252Fm8%252Ffeeds%252F",
SigningBindingElementBase_Accessor.ConstructSignatureBaseString(message, MessageDictionary_Accessor.AttachShadow(this.MessageDescriptions.GetAccessor(message))));
+
+ // This is a simulation of receiving the message, where the query string is still in the URL,
+ // but has been read into ExtraData, so parameters in the query string appear twice.
+ message = CreateTestRequestTokenMessage(
+ this.MessageDescriptions,
+ new MessageReceivingEndpoint("https://www.google.com/accounts/OAuthGetRequestToken?scope=http://www.google.com/m8/feeds/", HttpDeliveryMethods.AuthorizationHeaderRequest | HttpDeliveryMethods.PostRequest));
+ Assert.AreEqual(
+ "GET&https%3A%2F%2Fwww.google.com%2Faccounts%2FOAuthGetRequestToken&oauth_consumer_key%3Dnerdbank.org%26oauth_nonce%3Dfe4045a3f0efdd1e019fa8f8ae3f5c38%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1222665749%26oauth_version%3D1.0%26scope%3Dhttp%253A%252F%252Fwww.google.com%252Fm8%252Ffeeds%252F",
+ SigningBindingElementBase_Accessor.ConstructSignatureBaseString(message, MessageDictionary_Accessor.AttachShadow(this.MessageDescriptions.GetAccessor(message))));
}
internal static UnauthorizedTokenRequest CreateTestRequestTokenMessage(MessageDescriptionCollection messageDescriptions, MessageReceivingEndpoint endpoint) {