summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.AspNet/Clients/OAuth/OAuthClient.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.AspNet/Clients/OAuth/OAuthClient.cs')
-rw-r--r--src/DotNetOpenAuth.AspNet/Clients/OAuth/OAuthClient.cs17
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">