diff options
Diffstat (limited to 'src/OpenID/OpenIdProviderMvc/Code/FormsAuthenticationService.cs')
-rw-r--r-- | src/OpenID/OpenIdProviderMvc/Code/FormsAuthenticationService.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/OpenID/OpenIdProviderMvc/Code/FormsAuthenticationService.cs b/src/OpenID/OpenIdProviderMvc/Code/FormsAuthenticationService.cs new file mode 100644 index 0000000..22db860 --- /dev/null +++ b/src/OpenID/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(); + } + } +} |