//-----------------------------------------------------------------------
//
// Copyright (c) Outercurve Foundation. All rights reserved.
//
//-----------------------------------------------------------------------
namespace DotNetOpenAuth.Mvc {
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using DotNetOpenAuth.Messaging;
///
/// A set of customizations available for the scripts sent to the browser in AJAX OpenID scenarios.
///
public class OpenIdAjaxOptions {
///
/// Initializes a new instance of the class.
///
public OpenIdAjaxOptions() {
this.AssertionHiddenFieldId = "openid_openidAuthData";
this.ReturnUrlHiddenFieldId = "ReturnUrl";
}
///
/// Gets or sets the ID of the hidden field that should carry the positive assertion
/// until it is posted to the RP.
///
public string AssertionHiddenFieldId { get; set; }
///
/// Gets or sets the ID of the hidden field that should be set with the parent window/frame's URL
/// prior to posting the form with the positive assertion. Useful for jQuery popup dialogs.
///
public string ReturnUrlHiddenFieldId { get; set; }
///
/// Gets or sets the index of the form in the document.forms array on the browser that should
/// be submitted when the user is ready to send the positive assertion to the RP.
///
public int FormIndex { get; set; }
///
/// Gets or sets the id of the form in the document.forms array on the browser that should
/// be submitted when the user is ready to send the positive assertion to the RP. A value
/// in this property takes precedence over any value in the property.
///
/// The form id.
public string FormId { get; set; }
///
/// Gets or sets the preloaded discovery results.
///
public string PreloadedDiscoveryResults { get; set; }
///
/// Gets or sets a value indicating whether to print diagnostic trace messages in the browser.
///
public bool ShowDiagnosticTrace { get; set; }
///
/// Gets or sets a value indicating whether to show all the "hidden" iframes that facilitate
/// asynchronous authentication of the user for diagnostic purposes.
///
public bool ShowDiagnosticIFrame { get; set; }
///
/// Gets the form key to use when accessing the relevant form.
///
internal string FormKey {
get { return string.IsNullOrEmpty(this.FormId) ? this.FormIndex.ToString(CultureInfo.InvariantCulture) : MessagingUtilities.GetSafeJavascriptValue(this.FormId); }
}
}
}