Skip to content
This repository has been archived by the owner on Mar 20, 2019. It is now read-only.

Commit

Permalink
Added Immediate mode option to login sample page.
Browse files Browse the repository at this point in the history
  • Loading branch information
AArnott committed Apr 5, 2008
1 parent 62faadb commit 25d9ed7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
5 changes: 3 additions & 2 deletions samples/RelyingPartyPortal/login.aspx
Expand Up @@ -9,11 +9,12 @@
<body>
<form id="Form1" runat="server">
<h2>
Login Page</h2>
Login Page </h2>
<cc1:OpenIdLogin ID="OpenIdLogin1" runat="server" CssClass="openid_login" RequestCountry="Request"
RequestEmail="Request" RequestGender="Require" RequestPostalCode="Require" RequestTimeZone="Require"
RememberMeVisible="True" PolicyUrl="~/PrivacyPolicy.aspx" TabIndex="1" OnLoggedIn="OpenIdLogin1_LoggedIn"
OnCanceled="OpenIdLogin1_Canceled" OnError="OpenIdLogin1_Error" />
OnCanceled="OpenIdLogin1_Canceled" OnError="OpenIdLogin1_Error" OnFailed="OpenIdLogin1_Failed" />
<asp:CheckBox ID="immediateCheckBox" runat="server" Text="Immediate mode" />
<br />
<asp:Label ID="loginFailedLabel" runat="server" EnableViewState="False" Text="Login failed"
Visible="False" />
Expand Down
8 changes: 8 additions & 0 deletions samples/RelyingPartyPortal/login.aspx.cs
Expand Up @@ -7,6 +7,7 @@ public partial class login : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
{
OpenIdLogin1.Focus();
OpenIdLogin1.ImmediateMode = immediateCheckBox.Checked;
}

/// <summary>
Expand Down Expand Up @@ -34,4 +35,11 @@ protected void OpenIdLogin1_Canceled(object sender, OpenIdEventArgs e)
// We don't listen for the response from the provider explicitly
// because the OpenIdLogin control is already doing that for us.
}

protected void OpenIdLogin1_Failed(object sender, OpenIdEventArgs e) {
if (e.Response.Status == AuthenticationStatus.SetupRequired) {
loginFailedLabel.Text = "You must log into your Provider first to use Immediate mode.";
loginFailedLabel.Visible = true;
}
}
}
9 changes: 9 additions & 0 deletions samples/RelyingPartyPortal/login.aspx.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 25d9ed7

Please sign in to comment.