diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2012-06-10 18:12:31 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2012-06-10 18:12:31 -0700 |
commit | 4aa2ffd3206cd342282e6bf3e0a518a6d0f65529 (patch) | |
tree | 149114a89f4eeea76c9e1f5a0e2e0ef4f5c6d36d /src/DotNetOpenAuth.AspNet/Clients/OAuth/OAuthClient.cs | |
parent | f70166165c385afa52393bbe384f65c100ef94e5 (diff) | |
parent | 9ba6f876e55dfb12126081c57ae146cbe09ede53 (diff) | |
download | DotNetOpenAuth-4aa2ffd3206cd342282e6bf3e0a518a6d0f65529.zip DotNetOpenAuth-4aa2ffd3206cd342282e6bf3e0a518a6d0f65529.tar.gz DotNetOpenAuth-4aa2ffd3206cd342282e6bf3e0a518a6d0f65529.tar.bz2 |
Merge branch 'v4.0'
Conflicts:
projecttemplates/projecttemplates.proj
Diffstat (limited to 'src/DotNetOpenAuth.AspNet/Clients/OAuth/OAuthClient.cs')
-rw-r--r-- | src/DotNetOpenAuth.AspNet/Clients/OAuth/OAuthClient.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.AspNet/Clients/OAuth/OAuthClient.cs b/src/DotNetOpenAuth.AspNet/Clients/OAuth/OAuthClient.cs index 3f9e85a..9a9f40d 100644 --- a/src/DotNetOpenAuth.AspNet/Clients/OAuth/OAuthClient.cs +++ b/src/DotNetOpenAuth.AspNet/Clients/OAuth/OAuthClient.cs @@ -8,7 +8,10 @@ namespace DotNetOpenAuth.AspNet.Clients { using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; + using System.IO; using System.Web; + using System.Xml; + using System.Xml.Linq; using DotNetOpenAuth.Messaging; using DotNetOpenAuth.OAuth; using DotNetOpenAuth.OAuth.ChannelElements; @@ -154,6 +157,20 @@ namespace DotNetOpenAuth.AspNet.Clients { #region Methods /// <summary> + /// Helper method to load an XDocument from an input stream. + /// </summary> + /// <param name="stream">The input stream from which to load the document.</param> + /// <returns>The XML document.</returns> + internal static XDocument LoadXDocumentFromStream(Stream stream) { + const int MaxChars = 0x10000; // 64k + + XmlReaderSettings settings = new XmlReaderSettings() { + MaxCharactersInDocument = MaxChars + }; + return XDocument.Load(XmlReader.Create(stream, settings)); + } + + /// <summary> /// Check if authentication succeeded after user is redirected back from the service provider. /// </summary> /// <param name="response"> |