diff options
Diffstat (limited to 'samples/RelyingPartyWebForms/Code/State.cs')
-rw-r--r-- | samples/RelyingPartyWebForms/Code/State.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/samples/RelyingPartyWebForms/Code/State.cs b/samples/RelyingPartyWebForms/Code/State.cs new file mode 100644 index 0000000..857e02a --- /dev/null +++ b/samples/RelyingPartyWebForms/Code/State.cs @@ -0,0 +1,32 @@ +namespace RelyingPartyWebForms { + 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; + } + } +}
\ No newline at end of file |