diff options
Diffstat (limited to 'src/DotNetOAuth/Messages/GetAccessTokenMessage.cs')
-rw-r--r-- | src/DotNetOAuth/Messages/GetAccessTokenMessage.cs | 13 |
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));
+ }
+ }
}
}
|