summaryrefslogtreecommitdiffstats
path: root/samples/OpenIdProviderMvc/Code/FormsAuthenticationService.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-03-16 09:22:08 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2009-03-16 09:22:08 -0700
commit45068758daa9d7747565af3f95bea7abfa2db54a (patch)
treeb11c17d32763b77e4bfc03005e202b0c14e8bbdf /samples/OpenIdProviderMvc/Code/FormsAuthenticationService.cs
parente72da4887ebf36073d1235e28e44b44004602311 (diff)
downloadDotNetOpenAuth-45068758daa9d7747565af3f95bea7abfa2db54a.zip
DotNetOpenAuth-45068758daa9d7747565af3f95bea7abfa2db54a.tar.gz
DotNetOpenAuth-45068758daa9d7747565af3f95bea7abfa2db54a.tar.bz2
Added ASP.NET MVC OpenID Provider sample.
Diffstat (limited to 'samples/OpenIdProviderMvc/Code/FormsAuthenticationService.cs')
-rw-r--r--samples/OpenIdProviderMvc/Code/FormsAuthenticationService.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/samples/OpenIdProviderMvc/Code/FormsAuthenticationService.cs b/samples/OpenIdProviderMvc/Code/FormsAuthenticationService.cs
new file mode 100644
index 0000000..22db860
--- /dev/null
+++ b/samples/OpenIdProviderMvc/Code/FormsAuthenticationService.cs
@@ -0,0 +1,21 @@
+namespace OpenIdProviderMvc.Code {
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Web;
+ using System.Web.Security;
+
+ public class FormsAuthenticationService : IFormsAuthentication {
+ public string SignedInUsername {
+ get { return HttpContext.Current.User.Identity.Name; }
+ }
+
+ public void SignIn(string userName, bool createPersistentCookie) {
+ FormsAuthentication.SetAuthCookie(userName, createPersistentCookie);
+ }
+
+ public void SignOut() {
+ FormsAuthentication.SignOut();
+ }
+ }
+}