diff --git a/Teknik/Global.asax.cs b/Teknik/Global.asax.cs index c4fff7b..4f166a2 100644 --- a/Teknik/Global.asax.cs +++ b/Teknik/Global.asax.cs @@ -77,71 +77,6 @@ namespace Teknik } } - //protected void Application_PostAuthenticateRequest(Object sender, EventArgs e) - //{ - // // We support both Auth Tokens and Cookie Authentication - - // // Username and Roles for the current user - // string username = string.Empty; - - // bool hasAuthToken = false; - // if (Request != null) - // { - // if (Request.Headers.HasKeys()) - // { - // string auth = Request.Headers["Authorization"]; - // if (!string.IsNullOrEmpty(auth)) - // { - // string[] parts = auth.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - // string type = string.Empty; - // string value = string.Empty; - // if (parts.Length > 0) - // { - // type = parts[0].ToLower(); - // } - // if (parts.Length > 1) - // { - // value = parts[1]; - // } - - // using (TeknikEntities entities = new TeknikEntities()) - // { - // // Get the user information based on the auth type - // switch (type) - // { - // case "basic": - // KeyValuePair authCreds = StringHelper.ParseBasicAuthHeader(value); - - // bool tokenValid = UserHelper.UserTokenCorrect(entities, authCreds.Key, authCreds.Value); - // if (tokenValid) - // { - // // it's valid, so let's update it's Last Used date - // UserHelper.UpdateTokenLastUsed(entities, authCreds.Key, authCreds.Value, DateTime.Now); - - // // Set the username - // username = authCreds.Key; - // } - // break; - // default: - // break; - // } - // } - // } - // } - // } - - // if (FormsAuthentication.CookiesSupported == true && !hasAuthToken) - // { - // if (Request.Cookies[FormsAuthentication.FormsCookieName] != null) - // { - // //let us take out the username now - // username = FormsAuthentication.Decrypt(Request.Cookies[FormsAuthentication.FormsCookieName].Value).Name; - // } - // } - - // HttpContext.Current.User = new TeknikPrincipal(username); - //} - protected void Application_Error(object sender, EventArgs e) { Exception exception = null; diff --git a/Teknik/Modules/UserCheckModule.cs b/Teknik/Modules/UserAuthModule.cs similarity index 98% rename from Teknik/Modules/UserCheckModule.cs rename to Teknik/Modules/UserAuthModule.cs index 8ba7b48..3742ce4 100644 --- a/Teknik/Modules/UserCheckModule.cs +++ b/Teknik/Modules/UserAuthModule.cs @@ -12,7 +12,7 @@ using Teknik.Utilities; namespace Teknik.Modules { - public class UserCheckModule : IHttpModule + public class UserAuthModule : IHttpModule { public void Dispose() { diff --git a/Teknik/Teknik.csproj b/Teknik/Teknik.csproj index 4a45eb9..ef2f802 100644 --- a/Teknik/Teknik.csproj +++ b/Teknik/Teknik.csproj @@ -310,7 +310,7 @@ - + diff --git a/Teknik/Web.config b/Teknik/Web.config index 4eb73af..9805ea8 100644 --- a/Teknik/Web.config +++ b/Teknik/Web.config @@ -55,7 +55,7 @@ - + @@ -134,6 +134,7 @@ +