summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/DotNetOpenAuth/Messaging/MessagingUtilities.cs28
-rw-r--r--src/DotNetOpenAuth/Mvc/OpenIdAjaxOptions.cs5
-rw-r--r--src/DotNetOpenAuth/Mvc/OpenIdHelper.cs4
3 files changed, 23 insertions, 14 deletions
diff --git a/src/DotNetOpenAuth/Messaging/MessagingUtilities.cs b/src/DotNetOpenAuth/Messaging/MessagingUtilities.cs
index 8ae228d..7367c01 100644
--- a/src/DotNetOpenAuth/Messaging/MessagingUtilities.cs
+++ b/src/DotNetOpenAuth/Messaging/MessagingUtilities.cs
@@ -176,6 +176,20 @@ namespace DotNetOpenAuth.Messaging {
}
/// <summary>
+ /// Flattens the specified sequence of sequences.
+ /// </summary>
+ /// <typeparam name="T">The type of element contained in the sequence.</typeparam>
+ /// <param name="sequence">The sequence of sequences to flatten.</param>
+ /// <returns>A sequence of the contained items.</returns>
+ public static IEnumerable<T> Flatten<T>(this IEnumerable<IEnumerable<T>> sequence) {
+ foreach (IEnumerable<T> subsequence in sequence) {
+ foreach (T item in subsequence) {
+ yield return item;
+ }
+ }
+ }
+
+ /// <summary>
/// Sends a multipart HTTP POST request (useful for posting files) but doesn't call GetResponse on it.
/// </summary>
/// <param name="request">The HTTP request.</param>
@@ -473,20 +487,6 @@ namespace DotNetOpenAuth.Messaging {
}
/// <summary>
- /// Flattens the specified sequence of sequences.
- /// </summary>
- /// <typeparam name="T">The type of element contained in the sequence.</typeparam>
- /// <param name="sequence">The sequence of sequences to flatten.</param>
- /// <returns>A sequence of the contained items.</returns>
- internal static IEnumerable<T> Flatten<T>(this IEnumerable<IEnumerable<T>> sequence) {
- foreach (IEnumerable<T> subsequence in sequence) {
- foreach (T item in subsequence) {
- yield return item;
- }
- }
- }
-
- /// <summary>
/// Tests whether two arrays are equal in contents and ordering.
/// </summary>
/// <typeparam name="T">The type of elements in the arrays.</typeparam>
diff --git a/src/DotNetOpenAuth/Mvc/OpenIdAjaxOptions.cs b/src/DotNetOpenAuth/Mvc/OpenIdAjaxOptions.cs
index a412ef2..9956966 100644
--- a/src/DotNetOpenAuth/Mvc/OpenIdAjaxOptions.cs
+++ b/src/DotNetOpenAuth/Mvc/OpenIdAjaxOptions.cs
@@ -41,6 +41,11 @@ namespace DotNetOpenAuth.Mvc {
public int FormIndex { get; set; }
/// <summary>
+ /// Gets or sets the preloaded discovery results.
+ /// </summary>
+ public string PreloadedDiscoveryResults { get; set; }
+
+ /// <summary>
/// Gets or sets a value indicating whether to print diagnostic trace messages in the browser.
/// </summary>
public bool ShowDiagnosticTrace { get; set; }
diff --git a/src/DotNetOpenAuth/Mvc/OpenIdHelper.cs b/src/DotNetOpenAuth/Mvc/OpenIdHelper.cs
index 55af17d..03d2a07 100644
--- a/src/DotNetOpenAuth/Mvc/OpenIdHelper.cs
+++ b/src/DotNetOpenAuth/Mvc/OpenIdHelper.cs
@@ -124,6 +124,10 @@ window.openid_trace = {1}; // causes lots of messages";
OpenIdRelyingPartyAjaxControlBase.MaxPositiveAssertionLifetimeJsName,
assertionLifetimeInMilliseconds.ToString(CultureInfo.InvariantCulture));
+ if (additionalOptions.PreloadedDiscoveryResults != null) {
+ blockBuilder.WriteLine(additionalOptions.PreloadedDiscoveryResults);
+ }
+
string discoverUrl = VirtualPathUtility.AppendTrailingSlash(HttpContext.Current.Request.ApplicationPath) + html.RouteCollection["OpenIdDiscover"].GetVirtualPath(html.ViewContext.RequestContext, new RouteValueDictionary(new { identifier = "xxx" })).VirtualPath;
string blockFormat = @" {0} = function (argument, resultFunction, errorCallback) {{
jQuery.ajax({{