* *.cs -- *EventHandler.cs - Minor Corrections.
* Others -- Either complete, or first draft.
* ChangeLog, TODO -- Updated in accordance.
svn path=/trunk/mcs/; revision=2900
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,
--- /dev/null
+/**\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
/**
- * Namespace: System.Web.UI.Security
+ * Namespace: System.Web.Security
*
* Author: Gaurav Vaish
* Maintainer: gvaish@iitk.ac.in
* (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
--- /dev/null
+/**\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
--- /dev/null
+/**\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
--- /dev/null
+/**\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
--- /dev/null
+/**\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
/**
- * Namespace: System.Web.UI.Security
+ * Namespace: System.Web.Security
*
* Author: Gaurav Vaish
* Maintainer: gvaish@iitk.ac.in
* (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
--- /dev/null
+/**\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
/**
- * Namespace: System.Web.UI.Security
+ * Namespace: System.Web.Security
*
* Author: Gaurav Vaish
* Maintainer: gvaish@iitk.ac.in
* (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
&: 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
--- /dev/null
+/**\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
/**
- * Namespace: System.Web.UI.Security
+ * Namespace: System.Web.Security
*
* Author: Gaurav Vaish
* Maintainer: gvaish@iitk.ac.in
* (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