summaryrefslogtreecommitdiffstats
path: root/samples/RelyingPartyPortal
diff options
context:
space:
mode:
Diffstat (limited to 'samples/RelyingPartyPortal')
-rw-r--r--samples/RelyingPartyPortal/Code/State.cs34
-rw-r--r--samples/RelyingPartyPortal/Global.asax.cs5
-rw-r--r--samples/RelyingPartyPortal/MembersOnly/Default.aspx4
3 files changed, 14 insertions, 29 deletions
diff --git a/samples/RelyingPartyPortal/Code/State.cs b/samples/RelyingPartyPortal/Code/State.cs
index 65e676c..642780c 100644
--- a/samples/RelyingPartyPortal/Code/State.cs
+++ b/samples/RelyingPartyPortal/Code/State.cs
@@ -1,34 +1,12 @@
-using System;
-using System.Data;
-using System.Configuration;
using System.Web;
-using System.Web.Security;
-using System.Web.UI;
-using System.Web.UI.WebControls;
-using System.Web.UI.WebControls.WebParts;
-using System.Web.UI.HtmlControls;
using DotNetOpenId.Extensions.SimpleRegistration;
/// <summary>
-/// Summary description for State
+/// Strong-typed bag of session state.
/// </summary>
-public class State
-{
- public State()
- {
- }
-
- public static ClaimsResponse ProfileFields
- {
- get
- {
- if (HttpContext.Current .Session["ProfileFields"] == null)
- {
- HttpContext.Current .Session["ProfileFields"] = new ClaimsResponse();
- }
- return (ClaimsResponse)HttpContext.Current .Session["ProfileFields"];
- }
- set { HttpContext.Current .Session["ProfileFields"] = value; }
- }
-
+public class State {
+ public static ClaimsResponse ProfileFields {
+ get { return HttpContext.Current.Session["ProfileFields"] as ClaimsResponse; }
+ set { HttpContext.Current.Session["ProfileFields"] = value; }
+ }
}
diff --git a/samples/RelyingPartyPortal/Global.asax.cs b/samples/RelyingPartyPortal/Global.asax.cs
index eb61da9..259512f 100644
--- a/samples/RelyingPartyPortal/Global.asax.cs
+++ b/samples/RelyingPartyPortal/Global.asax.cs
@@ -8,6 +8,11 @@ namespace ConsumerPortal {
public class Global : System.Web.HttpApplication {
internal static StringBuilder LogMessages = new StringBuilder();
+ public Global() {
+ // since this is a sample, and will often be used with localhost
+ DotNetOpenId.UntrustedWebRequest.WhitelistHosts.Add("localhost");
+ }
+
public static log4net.ILog Logger = log4net.LogManager.GetLogger(typeof(Global));
protected void Application_Start(object sender, EventArgs e) {
diff --git a/samples/RelyingPartyPortal/MembersOnly/Default.aspx b/samples/RelyingPartyPortal/MembersOnly/Default.aspx
index 494ba71..c9b43e8 100644
--- a/samples/RelyingPartyPortal/MembersOnly/Default.aspx
+++ b/samples/RelyingPartyPortal/MembersOnly/Default.aspx
@@ -10,6 +10,7 @@
</p>
<asp:LoginStatus ID="LoginStatus1" runat="server" />
+<% if (State.ProfileFields != null) { %>
<p>
In addition to authenticating you, your OpenID Provider may
have told us something about you using the
@@ -89,4 +90,5 @@
</td>
</tr>
</table>
-</asp:Content> \ No newline at end of file
+<% } %>
+</asp:Content>