diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2008-11-08 07:54:27 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2008-11-08 07:54:27 -0800 |
commit | 1c3150f28e73c0022675007ee767c18f0493e2a5 (patch) | |
tree | 494b4a2dd39692fbc530f20323dd09444244776b | |
parent | 7cef282eb09c90c9a0d553964d42f131fea34efc (diff) | |
parent | 9474fa0139e3675e76841cf2e37342b04ed8a377 (diff) | |
download | DotNetOpenAuth-1c3150f28e73c0022675007ee767c18f0493e2a5.zip DotNetOpenAuth-1c3150f28e73c0022675007ee767c18f0493e2a5.tar.gz DotNetOpenAuth-1c3150f28e73c0022675007ee767c18f0493e2a5.tar.bz2 |
Merge branch 'v2.3' into v2.4
-rw-r--r-- | src/DotNetOpenId/RelyingParty/OpenIdTextBox.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/DotNetOpenId/RelyingParty/OpenIdTextBox.cs b/src/DotNetOpenId/RelyingParty/OpenIdTextBox.cs index a32cfea..1d23341 100644 --- a/src/DotNetOpenId/RelyingParty/OpenIdTextBox.cs +++ b/src/DotNetOpenId/RelyingParty/OpenIdTextBox.cs @@ -221,6 +221,7 @@ namespace DotNetOpenId.RelyingParty set { ViewState[showLogoViewStateKey] = value; }
}
+ const string usePersistentCookieCallbackKey = "OpenIdTextBox_UsePersistentCookie";
const string usePersistentCookieViewStateKey = "UsePersistentCookie";
/// <summary>
/// Default value of <see cref="UsePersistentCookie"/>.
@@ -593,6 +594,12 @@ namespace DotNetOpenId.RelyingParty if (!Enabled || Page.IsPostBack) return;
var consumer = createRelyingParty();
if (consumer.Response != null) {
+ string persistentString = consumer.Response.GetCallbackArgument(usePersistentCookieCallbackKey);
+ bool persistentBool;
+ if (persistentString != null && bool.TryParse(persistentString, out persistentBool)) {
+ UsePersistentCookie = persistentBool;
+ }
+
switch (consumer.Response.Status) {
case AuthenticationStatus.Canceled:
OnCanceled(consumer.Response);
@@ -686,6 +693,9 @@ namespace DotNetOpenId.RelyingParty Request = consumer.CreateRequest(userSuppliedIdentifier, new Realm(realm));
Request.Mode = ImmediateMode ? AuthenticationRequestMode.Immediate : AuthenticationRequestMode.Setup;
if (EnableRequestProfile) addProfileArgs(Request);
+
+ // Add state that needs to survive across the redirect.
+ Request.AddCallbackArguments(usePersistentCookieCallbackKey, UsePersistentCookie.ToString(CultureInfo.InvariantCulture));
} else {
Logger.WarnFormat("An invalid identifier was entered ({0}), but not caught by any validation routine.", Text);
Request = null;
|