2002-03-05 Gaurav Vaish <gvaish@iitk.ac.in>
authorGaurav Vaish <gvaish@mono-cvs.ximian.com>
Tue, 5 Mar 2002 11:17:46 +0000 (11:17 -0000)
committerGaurav Vaish <gvaish@mono-cvs.ximian.com>
Tue, 5 Mar 2002 11:17:46 +0000 (11:17 -0000)
* *.cs -- *EventHandler.cs - Minor Corrections.

* Others -- Either complete, or first draft.

* ChangeLog, TODO -- Updated in accordance.

svn path=/trunk/mcs/; revision=2900

13 files changed:
mcs/class/System.Web/System.Web.Security/ChangeLog
mcs/class/System.Web/System.Web.Security/DefaultAuthenticationEventArgs.cs [new file with mode: 0644]
mcs/class/System.Web/System.Web.Security/DefaultAuthenticationEventHandler.cs
mcs/class/System.Web/System.Web.Security/DefaultAuthenticationModule.cs [new file with mode: 0644]
mcs/class/System.Web/System.Web.Security/FileAuthorizationModule.cs [new file with mode: 0644]
mcs/class/System.Web/System.Web.Security/FormsAuthentication.cs [new file with mode: 0644]
mcs/class/System.Web/System.Web.Security/FormsAuthenticationEventArgs.cs [new file with mode: 0644]
mcs/class/System.Web/System.Web.Security/FormsAuthenticationEventHandler.cs
mcs/class/System.Web/System.Web.Security/PassportAuthenticationEventArgs.cs [new file with mode: 0644]
mcs/class/System.Web/System.Web.Security/PassportAuthenticationEventHandler.cs
mcs/class/System.Web/System.Web.Security/TODO
mcs/class/System.Web/System.Web.Security/WindowsAuthenticationEventArgs.cs [new file with mode: 0644]
mcs/class/System.Web/System.Web.Security/WindowsAuthenticationEventHandler.cs

index 51ed817a8f19b1af99d27a57a975eef920cac07e..237edb4cb6518da238f3ba104dc710019d8e6ae5 100644 (file)
@@ -1,5 +1,18 @@
 2002-03-05     Gaurav Vaish <gvaish@iitk.ac.in>
 
+       * DefaultAuthenticationModule.cs  - Initial implementation.
+       * FileAuthorizationModule.cs      - Initial implementation.
+       * FormsAuthentication.cs          - First touch.
+
+
+       * DefaultAuthenticationEventArgs.cs
+                                         - Completed.
+       * FormsAuthenticationEventArgs.cs,
+       * PassportAuthenticationEventArgs.cs,
+       * WindowsAuthenticationEventArgs.cs
+                                         - Initial Implementations.
+
+
        * DefaultAuthenticationEventHandler.cs,
        * FormsAuthenticationEventHandler.cs,
        * PassportAuthenticationEventHandler.cs, 
diff --git a/mcs/class/System.Web/System.Web.Security/DefaultAuthenticationEventArgs.cs b/mcs/class/System.Web/System.Web.Security/DefaultAuthenticationEventArgs.cs
new file mode 100644 (file)
index 0000000..a18b7f7
--- /dev/null
@@ -0,0 +1,36 @@
+/**\r
+ * Namespace: System.Web.Security\r
+ * Class:     DefaultAuthenticationEventArgs\r
+ * \r
+ * Author:  Gaurav Vaish\r
+ * Maintainer: gvaish@iitk.ac.in\r
+ * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>\r
+ * Implementation: yes\r
+ * Status:  100%\r
+ * \r
+ * (C) Gaurav Vaish (2002)\r
+ */\r
+\r
+using System;\r
+using System.Web;\r
+\r
+namespace System.Web.Security\r
+{\r
+       public sealed class DefaultAuthenticationEventArgs : EventArgs\r
+       {\r
+               HttpContext context;\r
+\r
+               public DefaultAuthenticationEventArgs(HttpContext context)\r
+               {\r
+                       this.context = context;\r
+               }\r
+               \r
+               public HttpContext Context\r
+               {\r
+                       get\r
+                       {\r
+                               return context;\r
+                       }\r
+               }\r
+       }\r
+}\r
index 81ec950cdbf1723b1eeef5505e0b9e48ff3b1387..501e1713d81c4ebfe8c9c45c229105359b946354 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * Namespace: System.Web.UI.Security
+ * Namespace: System.Web.Security
  *
  * Author: Gaurav Vaish
  * Maintainer: gvaish@iitk.ac.in
@@ -10,7 +10,7 @@
  * (C) Gaurav Vaish (2002)
  */
 
-namespace System.Web.UI.Security
+namespace System.Web.Security
 {
        public delegate void DefaultAuthenticationEventHandler(object sender, DefaultAuthenticationEventArgs e);
 }
\ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web.Security/DefaultAuthenticationModule.cs b/mcs/class/System.Web/System.Web.Security/DefaultAuthenticationModule.cs
new file mode 100644 (file)
index 0000000..7066d70
--- /dev/null
@@ -0,0 +1,52 @@
+/**\r
+ * Namespace: System.Web.Security\r
+ * Class:     DefaultAuthenticationModule\r
+ * \r
+ * Author:  Gaurav Vaish\r
+ * Maintainer: gvaish@iitk.ac.in\r
+ * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>\r
+ * Implementation: yes\r
+ * Status:  ??%\r
+ * \r
+ * (C) Gaurav Vaish (2002)\r
+ */\r
+\r
+using System;\r
+using System.Web;\r
+\r
+namespace System.Web.Security\r
+{\r
+       public sealed class DefaultAuthenticationModule : IHttpModule\r
+       {\r
+               private DefaultAuthenticationEventHandler authenticate;\r
+               \r
+               public DefaultAuthenticationModule()\r
+               {\r
+               }\r
+               \r
+               public void Dispose()\r
+               {\r
+               }\r
+               \r
+               [MonoTODO]\r
+               public void Init(HttpApplication app)\r
+               {\r
+                       //TODO: I have to add a DefaultAuthenticationEventHandler sort of thing\r
+                       // Could not find a suitable public delegate in HttpApplication.\r
+                       // Also need to define a method.\r
+                       throw new NotImplementedException();\r
+               }\r
+               \r
+               public event DefaultAuthenticationEventHandler Authenticate\r
+               {\r
+                       add\r
+                       {\r
+                               authenticate += value;\r
+                       }\r
+                       remove\r
+                       {\r
+                               authenticate -= value;\r
+                       }\r
+               }\r
+       }\r
+}\r
diff --git a/mcs/class/System.Web/System.Web.Security/FileAuthorizationModule.cs b/mcs/class/System.Web/System.Web.Security/FileAuthorizationModule.cs
new file mode 100644 (file)
index 0000000..6337bbe
--- /dev/null
@@ -0,0 +1,35 @@
+/**\r
+ * Namespace: System.Web.Security\r
+ * Class:     FileAuthorizationModule\r
+ * \r
+ * Author:  Gaurav Vaish\r
+ * Maintainer: gvaish@iitk.ac.in\r
+ * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>\r
+ * Implementation: yes\r
+ * Status:  ??%\r
+ * \r
+ * (C) Gaurav Vaish (2002)\r
+ */\r
+\r
+using System;\r
+using System.Web;\r
+\r
+namespace System.Web.Security\r
+{\r
+       public sealed class FileAuthorizationModule : IHttpModule\r
+       {\r
+               public FileAuthorizationModule()\r
+               {\r
+               }\r
+\r
+               public void Dispose()\r
+               {\r
+               }\r
+\r
+               [MonoTODO]\r
+               public void Init(HttpApplication app)\r
+               {\r
+                       throw new NotImplementedException();\r
+               }\r
+       }\r
+}\r
diff --git a/mcs/class/System.Web/System.Web.Security/FormsAuthentication.cs b/mcs/class/System.Web/System.Web.Security/FormsAuthentication.cs
new file mode 100644 (file)
index 0000000..c885534
--- /dev/null
@@ -0,0 +1,74 @@
+/**\r
+ * Namespace: System.Web.Security\r
+ * Class:     FormsAuthentication\r
+ * \r
+ * Author:  Gaurav Vaish\r
+ * Maintainer: gvaish@iitk.ac.in\r
+ * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>\r
+ * Implementation: yes\r
+ * Status:  ??%\r
+ * \r
+ * (C) Gaurav Vaish (2002)\r
+ */\r
+\r
+using System;\r
+using System.Web;\r
+\r
+namespace System.Web.Security\r
+{\r
+       public sealed class FormsAuthentication\r
+       {\r
+               private static formsCookieName;\r
+               private static formsCookiePath;\r
+               \r
+               private static bool isIntialized = false;\r
+\r
+               public FormsAuthentication()\r
+               {\r
+               }\r
+               \r
+               public static string FormsCookieName\r
+               {\r
+                       get\r
+                       {\r
+                               Initialize();\r
+                               return formsCookieName;\r
+                       }\r
+               }\r
+               \r
+               public static string FormsCookiePath\r
+               {\r
+                       get\r
+                       {\r
+                               Initialize();\r
+                               return formsCookiePath;\r
+                       }\r
+               }\r
+               \r
+               public static bool Authenticate(string name, string password)\r
+               {\r
+                       if(name != null && password != null)\r
+                       {\r
+                               Initialize();\r
+                               AuthenticationConfig cfg = (AuthenticatonConfig)HttpContext.Current.GetConfig("system.web/authentication");\r
+                               Hashtable db = cfg.Credentials;\r
+                               if(db == null)\r
+                               {\r
+                                       //TraceBack("No_user_database");\r
+                                       return false;\r
+                               }\r
+                               string passwd = (String)(db[name.ToLower()]);\r
+                               if(passwd == null)\r
+                               {\r
+                                       //Traceback("No_user_in_databse")\r
+                                       return false;\r
+                               }\r
+                               switch(cfg.PasswordFormat)\r
+                               {\r
+                                       \r
+                               }\r
+                       }\r
+                       return false;\r
+               }\r
+       }\r
+}\r
diff --git a/mcs/class/System.Web/System.Web.Security/FormsAuthenticationEventArgs.cs b/mcs/class/System.Web/System.Web.Security/FormsAuthenticationEventArgs.cs
new file mode 100644 (file)
index 0000000..7b94737
--- /dev/null
@@ -0,0 +1,52 @@
+/**\r
+ * Namespace: System.Web.Security\r
+ * Class:     FormsAuthenticationEventArgs\r
+ *\r
+ * Author:  Gaurav Vaish\r
+ * Maintainer: gvaish@iitk.ac.in\r
+ * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>\r
+ * Implementation: yes\r
+ * Status:  90%\r
+ *\r
+ * (C) Gaurav Vaish (2002)\r
+ */\r
+\r
+using System;\r
+using System.Web;\r
+using System.Security.Principal;\r
+\r
+namespace System.Web.Security\r
+{\r
+       public sealed class FormsAuthenticationEventArgs : EventArgs\r
+       {\r
+               HttpContext context;\r
+               IPrincipal  user;\r
+\r
+               public FormsAuthenticationEventArgs(HttpContext context)\r
+               {\r
+                       this.context = context;\r
+               }\r
+\r
+               public HttpContext Context\r
+               {\r
+                       get\r
+                       {\r
+                               return context;\r
+                       }\r
+               }\r
+\r
+               [MonoTODO]\r
+               public IPrincipal User\r
+               {\r
+                       get\r
+                       {\r
+                               return user;\r
+                       }\r
+                       set\r
+                       {\r
+                               // context.User?\r
+                               throw new NotImplementedException();\r
+                       }\r
+               }\r
+       }\r
+}\r
index 00974d072b3e931e66377cde6d1202b3018eff19..650d3246162a68597743e0c5fa57b5ea8882e023 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * Namespace: System.Web.UI.Security
+ * Namespace: System.Web.Security
  *
  * Author: Gaurav Vaish
  * Maintainer: gvaish@iitk.ac.in
@@ -10,7 +10,7 @@
  * (C) Gaurav Vaish (2002)
  */
 
-namespace System.Web.UI.Security
+namespace System.Web.Security
 {
        public delegate void FormsAuthenticationEventHandler(object sender, FormsAuthenticationEventArgs e);
 }
\ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web.Security/PassportAuthenticationEventArgs.cs b/mcs/class/System.Web/System.Web.Security/PassportAuthenticationEventArgs.cs
new file mode 100644 (file)
index 0000000..8fd6cc6
--- /dev/null
@@ -0,0 +1,60 @@
+/**\r
+ * Namespace: System.Web.Security\r
+ * Class:     PassportAuthenticationEventArgs\r
+ *\r
+ * Author:  Gaurav Vaish\r
+ * Maintainer: gvaish@iitk.ac.in\r
+ * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>\r
+ * Implementation: yes\r
+ * Status:  90%\r
+ *\r
+ * (C) Gaurav Vaish (2002)\r
+ */\r
+\r
+using System;\r
+using System.Security.Principal;\r
+using System.Web;\r
+\r
+namespace System.Web.Security\r
+{\r
+       public sealed class PassportAuthenticationEventArgs : EventArgs\r
+       {\r
+               HttpContext      context;\r
+               PassportIdentity identity;\r
+               IPrincipal       user;\r
+\r
+               public PassportAuthenticationEventArgs(PassportIdentity identity, HttpContext context)\r
+               {\r
+                       this.context = context;\r
+               }\r
+\r
+               public HttpContext Context\r
+               {\r
+                       get\r
+                       {\r
+                               return context;\r
+                       }\r
+               }\r
+\r
+               public PassportIdentity Identity\r
+               {\r
+                       get\r
+                       {\r
+                               return identity;\r
+                       }\r
+               }\r
+\r
+               [MonoTODO]\r
+               public IPrincipal User\r
+               {\r
+                       get\r
+                       {\r
+                               return user;\r
+                       }\r
+                       set\r
+                       {\r
+                               throw new NotImplementedException();\r
+                       }\r
+               }\r
+       }\r
+}\r
index 666996baeeab172594ef6216f8a81a2ba95ed751..1414c120f304501c4d8670375a94172311cd2c16 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * Namespace: System.Web.UI.Security
+ * Namespace: System.Web.Security
  *
  * Author: Gaurav Vaish
  * Maintainer: gvaish@iitk.ac.in
@@ -10,7 +10,7 @@
  * (C) Gaurav Vaish (2002)
  */
 
-namespace System.Web.UI.Security
+namespace System.Web.Security
 {
        public delegate void PassportAuthenticationEventHandler(object sender, PassportAuthenticationEventArgs e);
 }
\ No newline at end of file
index 764aa12901e52816b58cecf3233034af3b6a8b58..b85c046ac2a07618854f59302461ee96a88006b9 100644 (file)
@@ -16,19 +16,19 @@ All Classes and Delegates
 &: Work in progress. See <item-name>.cs file for maintainer's name
 </legends>
 
-DefaultAuthenticationEventArgs
-DefaultAuthenticationModule
-FileAuthorizationModule
-FormsAuthentication
-FormsAuthenticationEventArgs
+DefaultAuthenticationEventArgs
+DefaultAuthenticationModule
+FileAuthorizationModule
+FormsAuthentication
+FormsAuthenticationEventArgs
 FormsAuthenticationModule
 FormsAuthenticationTicket
 FormsIdentity
-PassportAuthenticationEventArgs
+PassportAuthenticationEventArgs
 PassportAuthenticationModule
 PassportIdentity
 UrlAuthorizationModule
-WindowsAuthenticationEventArgs
+WindowsAuthenticationEventArgs
 WindowsAuthenticationModule
 
 * DefaultAuthenticationEventHandler
diff --git a/mcs/class/System.Web/System.Web.Security/WindowsAuthenticationEventArgs.cs b/mcs/class/System.Web/System.Web.Security/WindowsAuthenticationEventArgs.cs
new file mode 100644 (file)
index 0000000..c7c62f6
--- /dev/null
@@ -0,0 +1,60 @@
+/**\r
+ * Namespace: System.Web.Security\r
+ * Class:     WindowsAuthenticationEventArgs\r
+ *\r
+ * Author:  Gaurav Vaish\r
+ * Maintainer: gvaish@iitk.ac.in\r
+ * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>\r
+ * Implementation: yes\r
+ * Status:  90%\r
+ *\r
+ * (C) Gaurav Vaish (2002)\r
+ */\r
+\r
+using System;\r
+using System.Web;\r
+using System.Security.Principal;\r
+\r
+namespace System.Web.Security\r
+{\r
+       public sealed class WindowsAuthenticationEventArgs : EventArgs\r
+       {\r
+               HttpContext      context;\r
+               WindowsIdentity identity;\r
+               IPrincipal       user;\r
+\r
+               public WindowsAuthenticationEventArgs(WindowsIdentity identity, HttpContext context)\r
+               {\r
+                       this.context = context;\r
+               }\r
+\r
+               public HttpContext Context\r
+               {\r
+                       get\r
+                       {\r
+                               return context;\r
+                       }\r
+               }\r
+\r
+               public WindowsIdentity Identity\r
+               {\r
+                       get\r
+                       {\r
+                               return identity;\r
+                       }\r
+               }\r
+\r
+               [MonoTODO]\r
+               public IPrincipal User\r
+               {\r
+                       get\r
+                       {\r
+                               return user;\r
+                       }\r
+                       set\r
+                       {\r
+                               throw new NotImplementedException();\r
+                       }\r
+               }\r
+       }\r
+}\r
index ffdb90ed183ed4de2a83a444a5aaaa6b050b8f3f..63e4a98fc3ad9751fb042c609720b57e7188dbf2 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * Namespace: System.Web.UI.Security
+ * Namespace: System.Web.Security
  *
  * Author: Gaurav Vaish
  * Maintainer: gvaish@iitk.ac.in
@@ -10,7 +10,7 @@
  * (C) Gaurav Vaish (2002)
  */
 
-namespace System.Web.UI.Security
+namespace System.Web.Security
 {
        public delegate void WindowsAuthenticationEventHandler(object sender, WindowsAuthenticationEventArgs e);
 }
\ No newline at end of file