summaryrefslogtreecommitdiffstats
path: root/samples/OpenIdRelyingPartyWebForms/Code/State.cs
blob: 4861a34f9ee37d9204cd71dfb1306d5961d8045a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
namespace OpenIdRelyingPartyWebForms {
	using System.Collections.Generic;
	using System.Web;
	using DotNetOpenAuth.OpenId.Extensions.ProviderAuthenticationPolicy;
	using DotNetOpenAuth.OpenId.Extensions.SimpleRegistration;

	/// <summary>
	/// Strong-typed bag of session state.
	/// </summary>
	public class State {
		public static ClaimsResponse ProfileFields {
			get { return HttpContext.Current.Session["ProfileFields"] as ClaimsResponse; }
			set { HttpContext.Current.Session["ProfileFields"] = value; }
		}

		public static string FriendlyLoginName {
			get { return HttpContext.Current.Session["FriendlyUsername"] as string; }
			set { HttpContext.Current.Session["FriendlyUsername"] = value; }
		}

		public static PolicyResponse PapePolicies {
			get { return HttpContext.Current.Session["PapePolicies"] as PolicyResponse; }
			set { HttpContext.Current.Session["PapePolicies"] = value; }
		}

		public static void Clear() {
			ProfileFields = null;
			FriendlyLoginName = null;
			PapePolicies = null;
		}
	}
}