[msvc] Update csproj files
[mono.git] / mcs / class / System / System.Net / AuthenticationManager.cs
index 2206f537dbe78f79461394e75baf935fb887714a..98200b45b4a01ad613756f7d16839f978ce1e08f 100644 (file)
 //
 
 using System.Collections;
+using System.Collections.Specialized;
 using System.Configuration;
+using System.Net.Configuration;
 
 namespace System.Net
 {
-       public class AuthenticationManager
-       {
+       public class AuthenticationManager {
                static ArrayList modules;
                static object locker = new object ();
 
@@ -50,10 +51,54 @@ namespace System.Net
                                        return;
                                
                                modules = new ArrayList ();
+#if MOBILE
+                               modules.Add (new NtlmClient ());
+                               modules.Add (new DigestClient ());
+                               modules.Add (new BasicClient ());
+#elif CONFIGURATION_DEP
+                               object cfg = ConfigurationManager.GetSection ("system.net/authenticationModules");
+                               AuthenticationModulesSection s = cfg as AuthenticationModulesSection;
+                               if (s != null) {
+                                       foreach (AuthenticationModuleElement element in s.AuthenticationModules) {
+                                               IAuthenticationModule module = null;
+                                               try {
+                                                       Type type = Type.GetType (element.Type, true);
+                                                       module = (IAuthenticationModule) Activator.CreateInstance (type);
+                                               } catch {}
+                                               modules.Add (module);
+                                       }
+                               }
+#else
                                ConfigurationSettings.GetConfig ("system.net/authenticationModules");
+#endif
+                       }
+               }
+               
+               static ICredentialPolicy credential_policy = null;
+               
+               public static ICredentialPolicy CredentialPolicy
+               {
+                       get {
+                               return(credential_policy);
+                                                       }
+                       set {
+                               credential_policy = value;
                        }
                }
                
+               static Exception GetMustImplement ()
+               {
+                       return new NotImplementedException ();
+               }
+               
+               [MonoTODO]
+               public static StringDictionary CustomTargetNameDictionary
+               {
+                       get {
+                               throw GetMustImplement ();
+                       }
+               }
+
                public static IEnumerator RegisteredModules {
                        get {
                                EnsureModules ();
@@ -61,6 +106,13 @@ namespace System.Net
                        }
                }
 
+               [MonoTODO]
+               internal static bool OSSupportsExtendedProtection {
+                       get {
+                               return false;
+                       }
+               }
+
                internal static void Clear ()
                {
                        EnsureModules ();
@@ -91,7 +143,7 @@ namespace System.Net
                                        if (auth == null)
                                                continue;
 
-                                       auth.Module = mod;
+                                       auth.ModuleAuthenticationType = mod.AuthenticationType;
                                        return auth;
                                }
                        }
@@ -114,7 +166,7 @@ namespace System.Net
                                        if (auth == null)
                                                continue;
 
-                                       auth.Module = mod;
+                                       auth.ModuleAuthenticationType = mod.AuthenticationType;
                                        return auth;
                                }
                        }