summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2012-12-24 07:18:24 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2012-12-24 07:18:24 -0800
commit8505f8ddcb35958e3b81ee90f54b0efbde13f693 (patch)
tree1451e89521445593087a55bd9729de8f743cf032
parentc7509b6d29ffe07098d0c2b81acbd1af34e1c076 (diff)
downloadDotNetOpenAuth-8505f8ddcb35958e3b81ee90f54b0efbde13f693.zip
DotNetOpenAuth-8505f8ddcb35958e3b81ee90f54b0efbde13f693.tar.gz
DotNetOpenAuth-8505f8ddcb35958e3b81ee90f54b0efbde13f693.tar.bz2
Adds ability for OAuth 2 clients to accept deeper access token JSON responses.
Fixes #168
-rw-r--r--src/DotNetOpenAuth.OAuth2.Client/OAuth2/ChannelElements/IOAuth2ChannelWithClient.cs6
-rw-r--r--src/DotNetOpenAuth.OAuth2.Client/OAuth2/ChannelElements/OAuth2ClientChannel.cs8
-rw-r--r--src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientBase.cs9
-rw-r--r--src/DotNetOpenAuth.Test/Mocks/CoordinatingOAuth2ClientChannel.cs4
4 files changed, 27 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ChannelElements/IOAuth2ChannelWithClient.cs b/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ChannelElements/IOAuth2ChannelWithClient.cs
index c802be6..db8b9f8 100644
--- a/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ChannelElements/IOAuth2ChannelWithClient.cs
+++ b/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ChannelElements/IOAuth2ChannelWithClient.cs
@@ -9,6 +9,7 @@ namespace DotNetOpenAuth.OAuth2.ChannelElements {
using System.Collections.Generic;
using System.Linq;
using System.Text;
+ using System.Xml;
/// <summary>
/// An interface that defines the OAuth2 client specific channel additions.
@@ -23,5 +24,10 @@ namespace DotNetOpenAuth.OAuth2.ChannelElements {
/// Gets or sets the client credentials applicator extension to use.
/// </summary>
ClientCredentialApplicator ClientCredentialApplicator { get; set; }
+
+ /// <summary>
+ /// Gets quotas used when deserializing JSON.
+ /// </summary>
+ XmlDictionaryReaderQuotas JsonReaderQuotas { get; }
}
}
diff --git a/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ChannelElements/OAuth2ClientChannel.cs b/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ChannelElements/OAuth2ClientChannel.cs
index 8ad2ed9..b0cdb4b 100644
--- a/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ChannelElements/OAuth2ClientChannel.cs
+++ b/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ChannelElements/OAuth2ClientChannel.cs
@@ -11,6 +11,7 @@ namespace DotNetOpenAuth.OAuth2.ChannelElements {
using System.Diagnostics.Contracts;
using System.Net;
using System.Web;
+ using System.Xml;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OAuth2.Messages;
@@ -50,6 +51,13 @@ namespace DotNetOpenAuth.OAuth2.ChannelElements {
public ClientCredentialApplicator ClientCredentialApplicator { get; set; }
/// <summary>
+ /// Gets quotas used when deserializing JSON.
+ /// </summary>
+ public XmlDictionaryReaderQuotas JsonReaderQuotas {
+ get { return this.XmlDictionaryReaderQuotas; }
+ }
+
+ /// <summary>
/// Prepares an HTTP request that carries a given message.
/// </summary>
/// <param name="request">The message to send.</param>
diff --git a/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientBase.cs b/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientBase.cs
index d4ea171..e17a6a1 100644
--- a/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientBase.cs
+++ b/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientBase.cs
@@ -16,6 +16,8 @@ namespace DotNetOpenAuth.OAuth2 {
#endif
using System.Security;
using System.Text;
+ using System.Xml;
+
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OAuth2.ChannelElements;
using DotNetOpenAuth.OAuth2.Messages;
@@ -71,6 +73,13 @@ namespace DotNetOpenAuth.OAuth2 {
}
/// <summary>
+ /// Gets quotas used when deserializing JSON.
+ /// </summary>
+ public XmlDictionaryReaderQuotas JsonReaderQuotas {
+ get { return this.OAuthChannel.JsonReaderQuotas; }
+ }
+
+ /// <summary>
/// Gets the OAuth client channel.
/// </summary>
internal IOAuth2ChannelWithClient OAuthChannel {
diff --git a/src/DotNetOpenAuth.Test/Mocks/CoordinatingOAuth2ClientChannel.cs b/src/DotNetOpenAuth.Test/Mocks/CoordinatingOAuth2ClientChannel.cs
index 52f381d..96091ac 100644
--- a/src/DotNetOpenAuth.Test/Mocks/CoordinatingOAuth2ClientChannel.cs
+++ b/src/DotNetOpenAuth.Test/Mocks/CoordinatingOAuth2ClientChannel.cs
@@ -29,5 +29,9 @@ namespace DotNetOpenAuth.Test.Mocks {
get { return this.wrappedChannel.ClientCredentialApplicator; }
set { this.wrappedChannel.ClientCredentialApplicator = value; }
}
+
+ public System.Xml.XmlDictionaryReaderQuotas JsonReaderQuotas {
+ get { return this.XmlDictionaryReaderQuotas; }
+ }
}
} \ No newline at end of file