summaryrefslogtreecommitdiffstats
path: root/src/DotNetOAuth/Messages/GetAccessTokenMessage.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2008-11-01 20:57:22 -0700
committerAndrew <andrewarnott@gmail.com>2008-11-01 20:57:22 -0700
commite3b0e50c390de98c9aadcf10451fd17611ad431b (patch)
treef182aa5ee46b1dc3086b4ca0693b41ab84d03032 /src/DotNetOAuth/Messages/GetAccessTokenMessage.cs
parentdb11b0a9fa4a304400ca1223427c3ca37f10004e (diff)
downloadDotNetOpenAuth-e3b0e50c390de98c9aadcf10451fd17611ad431b.zip
DotNetOpenAuth-e3b0e50c390de98c9aadcf10451fd17611ad431b.tar.gz
DotNetOpenAuth-e3b0e50c390de98c9aadcf10451fd17611ad431b.tar.bz2
Hugely refactored ServiceProvider and Consumer classes.
Messages are now exposed in the method signatures instead of raw Response instances.
Diffstat (limited to 'src/DotNetOAuth/Messages/GetAccessTokenMessage.cs')
-rw-r--r--src/DotNetOAuth/Messages/GetAccessTokenMessage.cs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/DotNetOAuth/Messages/GetAccessTokenMessage.cs b/src/DotNetOAuth/Messages/GetAccessTokenMessage.cs
index 45863d1..15c8ffd 100644
--- a/src/DotNetOAuth/Messages/GetAccessTokenMessage.cs
+++ b/src/DotNetOAuth/Messages/GetAccessTokenMessage.cs
@@ -7,6 +7,7 @@
namespace DotNetOAuth.Messages {
using System;
using DotNetOAuth.Messaging;
+ using System.Globalization;
/// <summary>
/// A direct message sent by the Consumer to exchange an authorized Request Token
@@ -37,5 +38,17 @@ namespace DotNetOAuth.Messages {
/// </summary>
[MessagePart("oauth_token", IsRequired = true)]
internal string RequestToken { get; set; }
+
+ /// <summary>
+ /// Checks the message state for conformity to the protocol specification
+ /// and throws an exception if the message is invalid.
+ /// </summary>
+ protected override void EnsureValidMessage() {
+ base.EnsureValidMessage();
+
+ if (this.ExtraData.Count > 0) {
+ throw new ProtocolException(string.Format(CultureInfo.CurrentCulture, Strings.MessageNotAllowedExtraParameters, GetType().Name));
+ }
+ }
}
}