summaryrefslogtreecommitdiffstats
path: root/samples/OpenIdRelyingPartyWebForms/MembersOnly
diff options
context:
space:
mode:
Diffstat (limited to 'samples/OpenIdRelyingPartyWebForms/MembersOnly')
-rw-r--r--samples/OpenIdRelyingPartyWebForms/MembersOnly/Default.aspx37
-rw-r--r--samples/OpenIdRelyingPartyWebForms/MembersOnly/DisplayGoogleContacts.aspx22
-rw-r--r--samples/OpenIdRelyingPartyWebForms/MembersOnly/DisplayGoogleContacts.aspx.cs50
-rw-r--r--samples/OpenIdRelyingPartyWebForms/MembersOnly/DisplayGoogleContacts.aspx.designer.cs69
-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/MembersOnly/Web.config18
8 files changed, 0 insertions, 309 deletions
diff --git a/samples/OpenIdRelyingPartyWebForms/MembersOnly/Default.aspx b/samples/OpenIdRelyingPartyWebForms/MembersOnly/Default.aspx
deleted file mode 100644
index 59a4eed..0000000
--- a/samples/OpenIdRelyingPartyWebForms/MembersOnly/Default.aspx
+++ /dev/null
@@ -1,37 +0,0 @@
-<%@ 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
- </h2>
- <p>
- Congratulations, <b><asp:LoginName ID="LoginName1" runat="server" /></b>.
- You have completed the OpenID login process.
- </p>
-
-<% if (State.PapePolicies != null) { %>
- <p>A PAPE extension was included in the authentication with this content: </p>
- <ul>
- <% if (State.PapePolicies.NistAssuranceLevel != null) {%>
- <li>Nist: <%=HttpUtility.HtmlEncode(State.PapePolicies.NistAssuranceLevel.Value.ToString())%></li>
- <% }
- foreach (string policy in State.PapePolicies.ActualPolicies) { %>
- <li><%=HttpUtility.HtmlEncode(policy) %></li>
- <% }
- if (State.PapePolicies.AuthenticationTimeUtc.HasValue) { %>
- <li>The provider authenticated the user at <%=State.PapePolicies.AuthenticationTimeUtc.Value.ToLocalTime() %> (local time)</li>
- <% } %>
- </ul>
-<% } %>
-
-<% 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>
- <cc1:ProfileFieldsDisplay runat="server" ID="profileFieldsDisplay" />
-<% } %>
-</asp:Content>
diff --git a/samples/OpenIdRelyingPartyWebForms/MembersOnly/DisplayGoogleContacts.aspx b/samples/OpenIdRelyingPartyWebForms/MembersOnly/DisplayGoogleContacts.aspx
deleted file mode 100644
index b8caa93..0000000
--- a/samples/OpenIdRelyingPartyWebForms/MembersOnly/DisplayGoogleContacts.aspx
+++ /dev/null
@@ -1,22 +0,0 @@
-<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Site.Master" CodeBehind="DisplayGoogleContacts.aspx.cs"
- Inherits="OpenIdRelyingPartyWebForms.MembersOnly.DisplayGoogleContacts" Async="true" %>
-
-<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="Main">
- <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
- <asp:View ID="View1" runat="server">
- <p>Obtain an access token by <asp:HyperLink NavigateUrl="~/loginPlusOAuth.aspx" runat="server"
- Text="logging in at our OpenID+OAuth hybrid login page" />. </p>
- <p>If you've already done that, then you might have inadvertently clicked "Allow [this
- site] to remember me", which causes Google to stop sending the access token that
- this sample doesn't save. If you did check it, you can restore this sample&#39;s
- functionality by <a href="https://www.google.com/accounts/IssuedAuthSubTokens">revoking
- access</a> to this site from your Google Account. </p>
- </asp:View>
- <asp:View ID="View2" runat="server">
- <h2>Address book</h2>
- <p>These are the contacts for Google Account: <asp:Label ID="emailLabel" runat="server"
- Font-Bold="True" /> and OpenID <asp:Label ID="claimedIdLabel" runat="server" Font-Bold="True" /></p>
- <asp:PlaceHolder ID="resultsPlaceholder" runat="server" />
- </asp:View>
- </asp:MultiView>
-</asp:Content>
diff --git a/samples/OpenIdRelyingPartyWebForms/MembersOnly/DisplayGoogleContacts.aspx.cs b/samples/OpenIdRelyingPartyWebForms/MembersOnly/DisplayGoogleContacts.aspx.cs
deleted file mode 100644
index d06e2f6..0000000
--- a/samples/OpenIdRelyingPartyWebForms/MembersOnly/DisplayGoogleContacts.aspx.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-namespace OpenIdRelyingPartyWebForms.MembersOnly {
- using System;
- using System.Linq;
- using System.Text;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Xml.Linq;
- using DotNetOpenAuth.ApplicationBlock;
- using DotNetOpenAuth.OpenId.Extensions.AttributeExchange;
-
- public partial class DisplayGoogleContacts : System.Web.UI.Page {
- protected void Page_Load(object sender, EventArgs e) {
- this.RegisterAsyncTask(
- new PageAsyncTask(
- async ct => {
- if (!string.IsNullOrEmpty(State.GoogleAccessToken.Token)) {
- this.MultiView1.ActiveViewIndex = 1;
- if (State.FetchResponse != null && State.FetchResponse.Attributes.Contains(WellKnownAttributes.Contact.Email)) {
- this.emailLabel.Text = State.FetchResponse.Attributes[WellKnownAttributes.Contact.Email].Values[0];
- } else {
- this.emailLabel.Text = "unavailable";
- }
- this.claimedIdLabel.Text = this.User.Identity.Name;
- var google = new GoogleConsumer {
- ConsumerKey = Global.GoogleWebConsumer.ConsumerKey,
- ConsumerSecret = Global.GoogleWebConsumer.ConsumerSecret,
- };
- var contactsDocument = await google.GetContactsAsync(State.GoogleAccessToken);
- this.RenderContacts(contactsDocument);
- }
- }));
- }
-
- private void RenderContacts(XDocument contactsDocument) {
- var contacts = from entry in contactsDocument.Root.Elements(XName.Get("entry", "http://www.w3.org/2005/Atom"))
- select new { Name = entry.Element(XName.Get("title", "http://www.w3.org/2005/Atom")).Value, Email = entry.Element(XName.Get("email", "http://schemas.google.com/g/2005")).Attribute("address").Value };
- StringBuilder tableBuilder = new StringBuilder();
- tableBuilder.Append("<table><tr><td>Name</td><td>Email</td></tr>");
- foreach (var contact in contacts) {
- tableBuilder.AppendFormat(
- "<tr><td>{0}</td><td>{1}</td></tr>",
- HttpUtility.HtmlEncode(contact.Name),
- HttpUtility.HtmlEncode(contact.Email));
- }
- tableBuilder.Append("</table>");
- this.resultsPlaceholder.Controls.Add(new Literal { Text = tableBuilder.ToString() });
- }
- }
-}
diff --git a/samples/OpenIdRelyingPartyWebForms/MembersOnly/DisplayGoogleContacts.aspx.designer.cs b/samples/OpenIdRelyingPartyWebForms/MembersOnly/DisplayGoogleContacts.aspx.designer.cs
deleted file mode 100644
index 9521781..0000000
--- a/samples/OpenIdRelyingPartyWebForms/MembersOnly/DisplayGoogleContacts.aspx.designer.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-//
-// 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 DisplayGoogleContacts {
-
- /// <summary>
- /// MultiView1 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.MultiView MultiView1;
-
- /// <summary>
- /// View1 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.View View1;
-
- /// <summary>
- /// View2 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.View View2;
-
- /// <summary>
- /// emailLabel 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 emailLabel;
-
- /// <summary>
- /// claimedIdLabel 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 claimedIdLabel;
-
- /// <summary>
- /// resultsPlaceholder 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.PlaceHolder resultsPlaceholder;
- }
-}
diff --git a/samples/OpenIdRelyingPartyWebForms/MembersOnly/ProfileFieldsDisplay.ascx b/samples/OpenIdRelyingPartyWebForms/MembersOnly/ProfileFieldsDisplay.ascx
deleted file mode 100644
index b2e5f7e..0000000
--- a/samples/OpenIdRelyingPartyWebForms/MembersOnly/ProfileFieldsDisplay.ascx
+++ /dev/null
@@ -1,75 +0,0 @@
-<%@ 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
deleted file mode 100644
index 4fb127e..0000000
--- a/samples/OpenIdRelyingPartyWebForms/MembersOnly/ProfileFieldsDisplay.ascx.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-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
deleted file mode 100644
index 4a5dc8a..0000000
--- a/samples/OpenIdRelyingPartyWebForms/MembersOnly/ProfileFieldsDisplay.ascx.designer.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//------------------------------------------------------------------------------
-// <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/MembersOnly/Web.config b/samples/OpenIdRelyingPartyWebForms/MembersOnly/Web.config
deleted file mode 100644
index 3cfad05..0000000
--- a/samples/OpenIdRelyingPartyWebForms/MembersOnly/Web.config
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Note: As an alternative to hand editing this file you can use the
- web admin tool to configure settings for your application. Use
- the Website->Asp.Net Configuration option in Visual Studio.
- A full list of settings and comments can be found in
- machine.config.comments usually located in
- \Windows\Microsoft.Net\Framework\v2.x\Config
--->
-<configuration>
- <appSettings/>
- <connectionStrings/>
- <system.web>
- <authorization>
- <deny users="?"/>
- </authorization>
- </system.web>
-</configuration>