summaryrefslogtreecommitdiffstats
path: root/samples/OpenIdRelyingPartyWebForms
diff options
context:
space:
mode:
Diffstat (limited to 'samples/OpenIdRelyingPartyWebForms')
-rw-r--r--samples/OpenIdRelyingPartyWebForms/MembersOnly/Default.aspx80
-rw-r--r--samples/OpenIdRelyingPartyWebForms/MembersOnly/ProfileFieldsDisplay.ascx75
-rw-r--r--samples/OpenIdRelyingPartyWebForms/MembersOnly/ProfileFieldsDisplay.ascx.cs13
-rw-r--r--samples/OpenIdRelyingPartyWebForms/MembersOnly/ProfileFieldsDisplay.ascx.designer.cs25
-rw-r--r--samples/OpenIdRelyingPartyWebForms/NoIdentityOpenId.aspx41
-rw-r--r--samples/OpenIdRelyingPartyWebForms/NoIdentityOpenId.aspx.cs79
-rw-r--r--samples/OpenIdRelyingPartyWebForms/NoIdentityOpenId.aspx.designer.cs115
-rw-r--r--samples/OpenIdRelyingPartyWebForms/OpenIdRelyingPartyWebForms.csproj16
-rw-r--r--samples/OpenIdRelyingPartyWebForms/Web.config7
-rw-r--r--samples/OpenIdRelyingPartyWebForms/login.aspx10
-rw-r--r--samples/OpenIdRelyingPartyWebForms/login.aspx.cs13
-rw-r--r--samples/OpenIdRelyingPartyWebForms/login.aspx.designer.cs13
-rw-r--r--samples/OpenIdRelyingPartyWebForms/loginProgrammatic.aspx1
-rw-r--r--samples/OpenIdRelyingPartyWebForms/loginProgrammatic.aspx.designer.cs11
-rw-r--r--samples/OpenIdRelyingPartyWebForms/xrds.aspx5
15 files changed, 398 insertions, 106 deletions
diff --git a/samples/OpenIdRelyingPartyWebForms/MembersOnly/Default.aspx b/samples/OpenIdRelyingPartyWebForms/MembersOnly/Default.aspx
index 46458e8..cbc13ee 100644
--- a/samples/OpenIdRelyingPartyWebForms/MembersOnly/Default.aspx
+++ b/samples/OpenIdRelyingPartyWebForms/MembersOnly/Default.aspx
@@ -1,6 +1,6 @@
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Site.Master" %>
<%@ Import Namespace="OpenIdRelyingPartyWebForms" %>
-
+<%@ Register Src="~/MembersOnly/ProfileFieldsDisplay.ascx" TagPrefix="cc1" TagName="ProfileFieldsDisplay" %>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="Main">
<h2>
Members Only Area
@@ -22,85 +22,13 @@
</ul>
<% } %>
-<% if (State.ProfileFields != null) { %>
+<% if (State.ProfileFields != null) {
+ profileFieldsDisplay.ProfileValues = State.ProfileFields; %>
<p>
In addition to authenticating you, your OpenID Provider may
have told us something about you using the
Simple Registration extension:
</p>
- <table id="profileFieldsTable" runat="server">
- <tr>
- <td>
- Nickname
- </td>
- <td>
- <%=State.ProfileFields.Nickname %>
- </td>
- </tr>
- <tr>
- <td>
- Email
- </td>
- <td>
- <%=State.ProfileFields.Email%>
- </td>
- </tr>
- <tr>
- <td>
- FullName
- </td>
- <td>
- <%=State.ProfileFields.FullName%>
- </td>
- </tr>
- <tr>
- <td>
- Date of Birth
- </td>
- <td>
- <%=State.ProfileFields.BirthDate.ToString()%>
- </td>
- </tr>
- <tr>
- <td>
- Gender
- </td>
- <td>
- <%=State.ProfileFields.Gender.ToString()%>
- </td>
- </tr>
- <tr>
- <td>
- Post Code
- </td>
- <td>
- <%=State.ProfileFields.PostalCode%>
- </td>
- </tr>
- <tr>
- <td>
- Country
- </td>
- <td>
- <%=State.ProfileFields.Country%>
- </td>
- </tr>
- <tr>
- <td>
- Language
- </td>
- <td>
- <%=State.ProfileFields.Language%>
- </td>
- </tr>
- <tr>
- <td>
- Timezone
- </td>
- <td>
- <%=State.ProfileFields.TimeZone%>
- </td>
- </tr>
- </table>
+ <cc1:ProfileFieldsDisplay runat="server" ID="profileFieldsDisplay" />
<% } %>
</asp:Content>
diff --git a/samples/OpenIdRelyingPartyWebForms/MembersOnly/ProfileFieldsDisplay.ascx b/samples/OpenIdRelyingPartyWebForms/MembersOnly/ProfileFieldsDisplay.ascx
new file mode 100644
index 0000000..b2e5f7e
--- /dev/null
+++ b/samples/OpenIdRelyingPartyWebForms/MembersOnly/ProfileFieldsDisplay.ascx
@@ -0,0 +1,75 @@
+<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ProfileFieldsDisplay.ascx.cs" Inherits="OpenIdRelyingPartyWebForms.MembersOnly.ProfileFieldsDisplay" %>
+<table id="profileFieldsTable" runat="server">
+ <tr>
+ <td>
+ Nickname
+ </td>
+ <td>
+ <%=ProfileValues.Nickname %>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ Email
+ </td>
+ <td>
+ <%=ProfileValues.Email%>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ FullName
+ </td>
+ <td>
+ <%=ProfileValues.FullName%>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ Date of Birth
+ </td>
+ <td>
+ <%=ProfileValues.BirthDate.ToString()%>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ Gender
+ </td>
+ <td>
+ <%=ProfileValues.Gender.ToString()%>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ Post Code
+ </td>
+ <td>
+ <%=ProfileValues.PostalCode%>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ Country
+ </td>
+ <td>
+ <%=ProfileValues.Country%>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ Language
+ </td>
+ <td>
+ <%=ProfileValues.Language%>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ Timezone
+ </td>
+ <td>
+ <%=ProfileValues.TimeZone%>
+ </td>
+ </tr>
+</table>
diff --git a/samples/OpenIdRelyingPartyWebForms/MembersOnly/ProfileFieldsDisplay.ascx.cs b/samples/OpenIdRelyingPartyWebForms/MembersOnly/ProfileFieldsDisplay.ascx.cs
new file mode 100644
index 0000000..4fb127e
--- /dev/null
+++ b/samples/OpenIdRelyingPartyWebForms/MembersOnly/ProfileFieldsDisplay.ascx.cs
@@ -0,0 +1,13 @@
+namespace OpenIdRelyingPartyWebForms.MembersOnly {
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Web;
+ using System.Web.UI;
+ using System.Web.UI.WebControls;
+ using DotNetOpenAuth.OpenId.Extensions.SimpleRegistration;
+
+ public partial class ProfileFieldsDisplay : System.Web.UI.UserControl {
+ public ClaimsResponse ProfileValues { get; set; }
+ }
+} \ No newline at end of file
diff --git a/samples/OpenIdRelyingPartyWebForms/MembersOnly/ProfileFieldsDisplay.ascx.designer.cs b/samples/OpenIdRelyingPartyWebForms/MembersOnly/ProfileFieldsDisplay.ascx.designer.cs
new file mode 100644
index 0000000..4a5dc8a
--- /dev/null
+++ b/samples/OpenIdRelyingPartyWebForms/MembersOnly/ProfileFieldsDisplay.ascx.designer.cs
@@ -0,0 +1,25 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.4918
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace OpenIdRelyingPartyWebForms.MembersOnly {
+
+
+ public partial class ProfileFieldsDisplay {
+
+ /// <summary>
+ /// profileFieldsTable control.
+ /// </summary>
+ /// <remarks>
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ /// </remarks>
+ protected global::System.Web.UI.HtmlControls.HtmlTable profileFieldsTable;
+ }
+}
diff --git a/samples/OpenIdRelyingPartyWebForms/NoIdentityOpenId.aspx b/samples/OpenIdRelyingPartyWebForms/NoIdentityOpenId.aspx
new file mode 100644
index 0000000..dc0c2bb
--- /dev/null
+++ b/samples/OpenIdRelyingPartyWebForms/NoIdentityOpenId.aspx
@@ -0,0 +1,41 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NoIdentityOpenId.aspx.cs"
+ MasterPageFile="~/Site.Master" Inherits="OpenIdRelyingPartyWebForms.NoIdentityOpenId" %>
+
+<asp:Content runat="server" ContentPlaceHolderID="Main">
+ <h2>No-login OpenID extension Page </h2>
+ <p>This demonstrates an RP sending an extension-only request to an OP that carries
+ extensions that request anonymous information about you. In this scenario, the OP
+ would still authenticate the user, but would not assert any OpenID Identifier back
+ to the RP, but might provide information regarding the user such as age or membership
+ in an organization. </p>
+ <p><b>Note: </b>At time of this writing, most OPs do not support this feature, although
+ it is documented in the OpenID 2.0 spec. </p>
+ <asp:Label ID="Label1" runat="server" Text="OpenID Identifier" /> <asp:TextBox ID="openIdBox"
+ runat="server" />
+ <asp:Button ID="beginButton" runat="server" Text="Begin" OnClick="beginButton_Click" />
+ <asp:CustomValidator runat="server" ID="openidValidator" ErrorMessage="Invalid OpenID Identifier"
+ ControlToValidate="openIdBox" EnableViewState="false" Display="Dynamic" OnServerValidate="openidValidator_ServerValidate" />
+ <asp:Label runat="server" EnableViewState="false" ID="resultMessage" />
+ <asp:Panel runat="server" ID="ExtensionResponsesPanel" EnableViewState="false" Visible="false">
+ <p>We have received a reasonable response from the Provider. Below is the Simple Registration
+ response we received, if any: </p>
+ <table id="profileFieldsTable" runat="server">
+ <tr>
+ <td>Gender </td>
+ <td><asp:Label runat="server" ID="genderLabel" /> </td>
+ </tr>
+ <tr>
+ <td>Post Code </td>
+ <td><asp:Label runat="server" ID="postalCodeLabel" /> </td>
+ </tr>
+ <tr>
+ <td>Country </td>
+ <td><asp:Label runat="server" ID="countryLabel" /> </td>
+ </tr>
+ <tr>
+ <td>Timezone </td>
+ <td><asp:Label runat="server" ID="timeZoneLabel" /> </td>
+ </tr>
+ </table>
+ </asp:Panel>
+</asp:Content>
diff --git a/samples/OpenIdRelyingPartyWebForms/NoIdentityOpenId.aspx.cs b/samples/OpenIdRelyingPartyWebForms/NoIdentityOpenId.aspx.cs
new file mode 100644
index 0000000..37a5515
--- /dev/null
+++ b/samples/OpenIdRelyingPartyWebForms/NoIdentityOpenId.aspx.cs
@@ -0,0 +1,79 @@
+namespace OpenIdRelyingPartyWebForms {
+ using System;
+ using System.Web.UI.WebControls;
+ using DotNetOpenAuth.Messaging;
+ using DotNetOpenAuth.OpenId;
+ using DotNetOpenAuth.OpenId.Extensions.SimpleRegistration;
+ using DotNetOpenAuth.OpenId.RelyingParty;
+
+ public partial class NoIdentityOpenId : System.Web.UI.Page {
+ protected void Page_Load(object sender, EventArgs e) {
+ this.openIdBox.Focus();
+ using (OpenIdRelyingParty rp = new OpenIdRelyingParty()) {
+ IAuthenticationResponse response = rp.GetResponse();
+ if (response != null) {
+ switch (response.Status) {
+ case AuthenticationStatus.ExtensionsOnly:
+ this.ExtensionResponsesPanel.Visible = true;
+
+ // This is the "success" status we get when no authentication was requested.
+ var sreg = response.GetExtension<ClaimsResponse>();
+ if (sreg != null) {
+ this.timeZoneLabel.Text = sreg.TimeZone;
+ this.postalCodeLabel.Text = sreg.PostalCode;
+ this.countryLabel.Text = sreg.Country;
+ if (sreg.Gender.HasValue) {
+ this.genderLabel.Text = sreg.Gender.Value.ToString();
+ }
+ }
+ break;
+ case AuthenticationStatus.Canceled:
+ this.resultMessage.Text = "Canceled at OP. This may be a sign that the OP doesn't support this message.";
+ break;
+ case AuthenticationStatus.Failed:
+ this.resultMessage.Text = "OP returned a failure: " + response.Exception;
+ break;
+ case AuthenticationStatus.SetupRequired:
+ case AuthenticationStatus.Authenticated:
+ default:
+ this.resultMessage.Text = "OP returned an unexpected response.";
+ break;
+ }
+ }
+ }
+ }
+
+ protected void beginButton_Click(object sender, EventArgs e) {
+ if (!this.Page.IsValid) {
+ return; // don't login if custom validation failed.
+ }
+ try {
+ using (OpenIdRelyingParty rp = new OpenIdRelyingParty()) {
+ var request = rp.CreateRequest(this.openIdBox.Text);
+ request.IsExtensionOnly = true;
+
+ // This is where you would add any OpenID extensions you wanted
+ // to include in the request.
+ request.AddExtension(new ClaimsRequest {
+ Country = DemandLevel.Request,
+ Gender = DemandLevel.Require,
+ PostalCode = DemandLevel.Require,
+ TimeZone = DemandLevel.Require,
+ });
+
+ request.RedirectToProvider();
+ }
+ } catch (ProtocolException ex) {
+ // The user probably entered an Identifier that
+ // was not a valid OpenID endpoint.
+ this.openidValidator.Text = ex.Message;
+ this.openidValidator.IsValid = false;
+ }
+ }
+
+ protected void openidValidator_ServerValidate(object source, ServerValidateEventArgs args) {
+ // This catches common typos that result in an invalid OpenID Identifier.
+ args.IsValid = Identifier.IsValid(args.Value);
+ }
+ }
+}
diff --git a/samples/OpenIdRelyingPartyWebForms/NoIdentityOpenId.aspx.designer.cs b/samples/OpenIdRelyingPartyWebForms/NoIdentityOpenId.aspx.designer.cs
new file mode 100644
index 0000000..fb959a3
--- /dev/null
+++ b/samples/OpenIdRelyingPartyWebForms/NoIdentityOpenId.aspx.designer.cs
@@ -0,0 +1,115 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.4918
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace OpenIdRelyingPartyWebForms {
+
+
+ public partial class NoIdentityOpenId {
+
+ /// <summary>
+ /// Label1 control.
+ /// </summary>
+ /// <remarks>
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ /// </remarks>
+ protected global::System.Web.UI.WebControls.Label Label1;
+
+ /// <summary>
+ /// openIdBox control.
+ /// </summary>
+ /// <remarks>
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ /// </remarks>
+ protected global::System.Web.UI.WebControls.TextBox openIdBox;
+
+ /// <summary>
+ /// beginButton control.
+ /// </summary>
+ /// <remarks>
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ /// </remarks>
+ protected global::System.Web.UI.WebControls.Button beginButton;
+
+ /// <summary>
+ /// openidValidator control.
+ /// </summary>
+ /// <remarks>
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ /// </remarks>
+ protected global::System.Web.UI.WebControls.CustomValidator openidValidator;
+
+ /// <summary>
+ /// resultMessage control.
+ /// </summary>
+ /// <remarks>
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ /// </remarks>
+ protected global::System.Web.UI.WebControls.Label resultMessage;
+
+ /// <summary>
+ /// ExtensionResponsesPanel control.
+ /// </summary>
+ /// <remarks>
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ /// </remarks>
+ protected global::System.Web.UI.WebControls.Panel ExtensionResponsesPanel;
+
+ /// <summary>
+ /// profileFieldsTable control.
+ /// </summary>
+ /// <remarks>
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ /// </remarks>
+ protected global::System.Web.UI.HtmlControls.HtmlTable profileFieldsTable;
+
+ /// <summary>
+ /// genderLabel control.
+ /// </summary>
+ /// <remarks>
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ /// </remarks>
+ protected global::System.Web.UI.WebControls.Label genderLabel;
+
+ /// <summary>
+ /// postalCodeLabel control.
+ /// </summary>
+ /// <remarks>
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ /// </remarks>
+ protected global::System.Web.UI.WebControls.Label postalCodeLabel;
+
+ /// <summary>
+ /// countryLabel control.
+ /// </summary>
+ /// <remarks>
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ /// </remarks>
+ protected global::System.Web.UI.WebControls.Label countryLabel;
+
+ /// <summary>
+ /// timeZoneLabel control.
+ /// </summary>
+ /// <remarks>
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ /// </remarks>
+ protected global::System.Web.UI.WebControls.Label timeZoneLabel;
+ }
+}
diff --git a/samples/OpenIdRelyingPartyWebForms/OpenIdRelyingPartyWebForms.csproj b/samples/OpenIdRelyingPartyWebForms/OpenIdRelyingPartyWebForms.csproj
index c45f007..d3bf92c 100644
--- a/samples/OpenIdRelyingPartyWebForms/OpenIdRelyingPartyWebForms.csproj
+++ b/samples/OpenIdRelyingPartyWebForms/OpenIdRelyingPartyWebForms.csproj
@@ -132,6 +132,13 @@
<Compile Include="MembersOnly\DisplayGoogleContacts.aspx.designer.cs">
<DependentUpon>DisplayGoogleContacts.aspx</DependentUpon>
</Compile>
+ <Compile Include="MembersOnly\ProfileFieldsDisplay.ascx.cs">
+ <DependentUpon>ProfileFieldsDisplay.ascx</DependentUpon>
+ <SubType>ASPXCodeBehind</SubType>
+ </Compile>
+ <Compile Include="MembersOnly\ProfileFieldsDisplay.ascx.designer.cs">
+ <DependentUpon>ProfileFieldsDisplay.ascx</DependentUpon>
+ </Compile>
<Compile Include="m\Login.aspx.cs">
<DependentUpon>Login.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@@ -139,6 +146,13 @@
<Compile Include="m\Login.aspx.designer.cs">
<DependentUpon>Login.aspx</DependentUpon>
</Compile>
+ <Compile Include="NoIdentityOpenId.aspx.cs">
+ <DependentUpon>NoIdentityOpenId.aspx</DependentUpon>
+ <SubType>ASPXCodeBehind</SubType>
+ </Compile>
+ <Compile Include="NoIdentityOpenId.aspx.designer.cs">
+ <DependentUpon>NoIdentityOpenId.aspx</DependentUpon>
+ </Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TracePage.aspx.cs">
<DependentUpon>TracePage.aspx</DependentUpon>
@@ -161,8 +175,10 @@
<Content Include="images\yahoo.png" />
<Content Include="loginPlusOAuth.aspx" />
<Content Include="MembersOnly\DisplayGoogleContacts.aspx" />
+ <Content Include="MembersOnly\ProfileFieldsDisplay.ascx" />
<Content Include="MembersOnly\Web.config" />
<Content Include="m\Login.aspx" />
+ <Content Include="NoIdentityOpenId.aspx" />
</ItemGroup>
<ItemGroup>
<None Include="Code\CustomStoreDataSet.xsc">
diff --git a/samples/OpenIdRelyingPartyWebForms/Web.config b/samples/OpenIdRelyingPartyWebForms/Web.config
index 7983e21..c48c198 100644
--- a/samples/OpenIdRelyingPartyWebForms/Web.config
+++ b/samples/OpenIdRelyingPartyWebForms/Web.config
@@ -23,12 +23,17 @@
<!--<servicePointManager checkCertificateRevocationList="true"/>-->
</settings>
</system.net>
-
<!-- this is an optional configuration section where aspects of dotnetopenauth can be customized -->
<dotNetOpenAuth>
<openid>
<relyingParty>
<security requireSsl="false" />
+ <behaviors>
+ <!-- The following OPTIONAL behavior allows RPs to use SREG only, but be compatible
+ with OPs that use Attribute Exchange (in various formats). -->
+ <add type="DotNetOpenAuth.OpenId.Behaviors.AXFetchAsSregTransform, DotNetOpenAuth" />
+ <!--<add type="DotNetOpenAuth.OpenId.Behaviors.GsaIcamProfile, DotNetOpenAuth" />-->
+ </behaviors>
<!-- Uncomment the following to activate the sample custom store. -->
<!--<store type="OpenIdRelyingPartyWebForms.CustomStore, OpenIdRelyingPartyWebForms" />-->
</relyingParty>
diff --git a/samples/OpenIdRelyingPartyWebForms/login.aspx b/samples/OpenIdRelyingPartyWebForms/login.aspx
index 6e66fd3..281725c 100644
--- a/samples/OpenIdRelyingPartyWebForms/login.aspx
+++ b/samples/OpenIdRelyingPartyWebForms/login.aspx
@@ -5,7 +5,7 @@
<asp:Content runat="server" ContentPlaceHolderID="Main">
<h2>Login Page </h2>
<rp:OpenIdLogin ID="OpenIdLogin1" runat="server" CssClass="openid_login" RequestCountry="Request"
- RequestEmail="Request" RequestGender="Require" RequestPostalCode="Require" RequestTimeZone="Require"
+ RequestEmail="Require" RequestGender="Require" RequestPostalCode="Require" RequestTimeZone="Require"
RememberMeVisible="True" PolicyUrl="~/PrivacyPolicy.aspx" TabIndex="1"
OnLoggedIn="OpenIdLogin1_LoggedIn" OnLoggingIn="OpenIdLogin1_LoggingIn"
OnSetupRequired="OpenIdLogin1_SetupRequired" />
@@ -13,18 +13,20 @@
<asp:CheckBox ID="requireSslCheckBox" runat="server"
Text="RequireSsl (high security) mode"
oncheckedchanged="requireSslCheckBox_CheckedChanged" /><br />
- <asp:CheckBox ID="immediateCheckBox" runat="server" Text="Immediate mode" /><br />
+ <h4 style="margin-top: 0; margin-bottom: 0">PAPE policies</h4>
<asp:CheckBoxList runat="server" ID="papePolicies">
<asp:ListItem Text="Request phishing resistant authentication" Value="http://schemas.openid.net/pape/policies/2007/06/phishing-resistant" />
<asp:ListItem Text="Request multi-factor authentication" Value="http://schemas.openid.net/pape/policies/2007/06/multi-factor" />
<asp:ListItem Text="Request physical multi-factor authentication" Value="http://schemas.openid.net/pape/policies/2007/06/multi-factor-physical" />
+ <asp:ListItem Text="Request PPID identifier" Value="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/privatepersonalidentifier" />
</asp:CheckBoxList>
+ <p>Try the PPID identifier functionality against the OpenIDProviderMvc sample.</p>
</fieldset>
<br />
<asp:Label ID="setupRequiredLabel" runat="server" EnableViewState="False" Text="You must log into your Provider first to use Immediate mode."
Visible="False" />
<p>
- <asp:ImageButton runat="server" ImageUrl="~/images/yahoo.png" ID="yahooLoginButton"
- OnClick="yahooLoginButton_Click" />
+ <rp:OpenIdButton runat="server" ImageUrl="~/images/yahoo.png" Text="Login with Yahoo!" ID="yahooLoginButton"
+ Identifier="https://me.yahoo.com/" />
</p>
</asp:Content>
diff --git a/samples/OpenIdRelyingPartyWebForms/login.aspx.cs b/samples/OpenIdRelyingPartyWebForms/login.aspx.cs
index 37a714c..1de942a 100644
--- a/samples/OpenIdRelyingPartyWebForms/login.aspx.cs
+++ b/samples/OpenIdRelyingPartyWebForms/login.aspx.cs
@@ -39,20 +39,7 @@ namespace OpenIdRelyingPartyWebForms {
this.setupRequiredLabel.Visible = true;
}
- protected void yahooLoginButton_Click(object sender, ImageClickEventArgs e) {
- OpenIdRelyingParty openid = new OpenIdRelyingParty();
- var req = openid.CreateRequest("yahoo.com");
- this.prepareRequest(req);
- req.RedirectToProvider();
-
- // We don't listen for the response from the provider explicitly
- // because the OpenIdLogin control is already doing that for us.
- }
-
private void prepareRequest(IAuthenticationRequest request) {
- // Setup is the default for the login control. But the user may have checked the box to override that.
- request.Mode = this.immediateCheckBox.Checked ? AuthenticationRequestMode.Immediate : AuthenticationRequestMode.Setup;
-
// Collect the PAPE policies requested by the user.
List<string> policies = new List<string>();
foreach (ListItem item in this.papePolicies.Items) {
diff --git a/samples/OpenIdRelyingPartyWebForms/login.aspx.designer.cs b/samples/OpenIdRelyingPartyWebForms/login.aspx.designer.cs
index 436ef7b..944f5ff 100644
--- a/samples/OpenIdRelyingPartyWebForms/login.aspx.designer.cs
+++ b/samples/OpenIdRelyingPartyWebForms/login.aspx.designer.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version:2.0.50727.4912
+// Runtime Version:2.0.50727.4918
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -32,15 +32,6 @@ namespace OpenIdRelyingPartyWebForms {
protected global::System.Web.UI.WebControls.CheckBox requireSslCheckBox;
/// <summary>
- /// immediateCheckBox control.
- /// </summary>
- /// <remarks>
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- /// </remarks>
- protected global::System.Web.UI.WebControls.CheckBox immediateCheckBox;
-
- /// <summary>
/// papePolicies control.
/// </summary>
/// <remarks>
@@ -65,6 +56,6 @@ namespace OpenIdRelyingPartyWebForms {
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
- protected global::System.Web.UI.WebControls.ImageButton yahooLoginButton;
+ protected global::DotNetOpenAuth.OpenId.RelyingParty.OpenIdButton yahooLoginButton;
}
}
diff --git a/samples/OpenIdRelyingPartyWebForms/loginProgrammatic.aspx b/samples/OpenIdRelyingPartyWebForms/loginProgrammatic.aspx
index a00eccd..78179f7 100644
--- a/samples/OpenIdRelyingPartyWebForms/loginProgrammatic.aspx
+++ b/samples/OpenIdRelyingPartyWebForms/loginProgrammatic.aspx
@@ -12,4 +12,5 @@
Visible="False" />
<asp:Label ID="loginCanceledLabel" runat="server" EnableViewState="False" Text="Login canceled"
Visible="False" />
+ <asp:CheckBox ID="noLoginCheckBox" runat="server" Text="Extensions only (no login) -- most OPs don't yet support this" />
</asp:Content> \ No newline at end of file
diff --git a/samples/OpenIdRelyingPartyWebForms/loginProgrammatic.aspx.designer.cs b/samples/OpenIdRelyingPartyWebForms/loginProgrammatic.aspx.designer.cs
index 0363be7..239d7b8 100644
--- a/samples/OpenIdRelyingPartyWebForms/loginProgrammatic.aspx.designer.cs
+++ b/samples/OpenIdRelyingPartyWebForms/loginProgrammatic.aspx.designer.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version:2.0.50727.4912
+// Runtime Version:2.0.50727.4918
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -66,5 +66,14 @@ namespace OpenIdRelyingPartyWebForms {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label loginCanceledLabel;
+
+ /// <summary>
+ /// noLoginCheckBox control.
+ /// </summary>
+ /// <remarks>
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ /// </remarks>
+ protected global::System.Web.UI.WebControls.CheckBox noLoginCheckBox;
}
}
diff --git a/samples/OpenIdRelyingPartyWebForms/xrds.aspx b/samples/OpenIdRelyingPartyWebForms/xrds.aspx
index e169bc7..52e27f7 100644
--- a/samples/OpenIdRelyingPartyWebForms/xrds.aspx
+++ b/samples/OpenIdRelyingPartyWebForms/xrds.aspx
@@ -17,6 +17,11 @@ is default.aspx.
<URI priority="1"><%=new Uri(Request.Url, Response.ApplyAppPathModifier("~/login.aspx"))%></URI>
<URI priority="2"><%=new Uri(Request.Url, Response.ApplyAppPathModifier("~/loginProgrammatic.aspx"))%></URI>
<URI priority="3"><%=new Uri(Request.Url, Response.ApplyAppPathModifier("~/ajaxlogin.aspx"))%></URI>
+ <URI priority="3"><%=new Uri(Request.Url, Response.ApplyAppPathModifier("~/NoIdentityOpenId.aspx"))%></URI>
+ </Service>
+ <Service>
+ <Type>http://specs.openid.net/extensions/ui/icon</Type>
+ <URI><%=new Uri(Request.Url, Response.ApplyAppPathModifier("~/images/dotnetopenid_tiny.gif"))%></URI>
</Service>
</XRD>
</xrds:XRDS>