當前位置: 首頁>>代碼示例>>C#>>正文


C# AuthenticationSchemes類代碼示例

本文整理匯總了C#中AuthenticationSchemes的典型用法代碼示例。如果您正苦於以下問題:C# AuthenticationSchemes類的具體用法?C# AuthenticationSchemes怎麽用?C# AuthenticationSchemes使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AuthenticationSchemes類屬於命名空間,在下文中一共展示了AuthenticationSchemes類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: DoesAuthTypeMatch

        public static bool DoesAuthTypeMatch(AuthenticationSchemes authScheme, string authType)
        {
            if ((authType == null) || (authType.Length == 0))
            {
                return authScheme.IsSet(AuthenticationSchemes.Anonymous);
            }

            if (authType.Equals("kerberos", StringComparison.OrdinalIgnoreCase) ||
                authType.Equals("negotiate", StringComparison.OrdinalIgnoreCase))
            {
                return authScheme.IsSet(AuthenticationSchemes.Negotiate);
            }
            else if (authType.Equals("ntlm", StringComparison.OrdinalIgnoreCase))
            {
                return authScheme.IsSet(AuthenticationSchemes.Negotiate) ||
                    authScheme.IsSet(AuthenticationSchemes.Ntlm);
            }

            AuthenticationSchemes authTypeScheme;
            if (!Enum.TryParse<AuthenticationSchemes>(authType, true, out authTypeScheme))
            {
                return false;
            }

            return authScheme.IsSet(authTypeScheme);
        }
開發者ID:nlh774,項目名稱:DotNetReferenceSource,代碼行數:26,代碼來源:AuthenticationSchemesHelper.cs

示例2: MapToClientCredentialType

 internal static HttpClientCredentialType MapToClientCredentialType(AuthenticationSchemes authenticationSchemes)
 {
     HttpClientCredentialType result;
     switch (authenticationSchemes)
     {
         case AuthenticationSchemes.Anonymous:
             result = HttpClientCredentialType.None;
             break;
         case AuthenticationSchemes.Basic:
             result = HttpClientCredentialType.Basic;
             break;
         case AuthenticationSchemes.Digest:
             result = HttpClientCredentialType.Digest;
             break;
         case AuthenticationSchemes.Ntlm:
             result = HttpClientCredentialType.Ntlm;
             break;
         case AuthenticationSchemes.Negotiate:
             result = HttpClientCredentialType.Windows;
             break;
         default:
             Fx.Assert("unsupported client AuthenticationScheme");
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException());
     }
     return result;
 }
開發者ID:nlh774,項目名稱:DotNetReferenceSource,代碼行數:26,代碼來源:HttpClientCredentialType.cs

示例3: HttpListener

 public HttpListener(ILogger logger)
 {
     _logger = logger;
     prefixes = new HttpListenerPrefixCollection(logger, this);
     registry = new Hashtable();
     connections = Hashtable.Synchronized(new Hashtable());
     auth_schemes = AuthenticationSchemes.Anonymous;
 }
開發者ID:WJ-GitHub,項目名稱:SocketHttpListener,代碼行數:8,代碼來源:HttpListener.cs

示例4: ServiceAuthenticationBehavior

 ServiceAuthenticationBehavior(ServiceAuthenticationBehavior other)
 {
     this.serviceAuthenticationManager = other.ServiceAuthenticationManager;
     this.authenticationSchemes = other.authenticationSchemes;
     this.isReadOnly = other.isReadOnly;
     this.isAuthenticationManagerSet = other.isAuthenticationManagerSet;
     this.isAuthenticationSchemesSet = other.isAuthenticationSchemesSet;
 }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:8,代碼來源:ServiceAuthenticationBehavior.cs

示例5: CreateAndStartListener

        public static HttpListener CreateAndStartListener (string prefix, AuthenticationSchemes authSchemes)
        {
            HttpListener listener = new HttpListener ();
            listener.AuthenticationSchemes = authSchemes;
            listener.Prefixes.Add (prefix);
            listener.Start ();
            return listener;
        }
開發者ID:frje,項目名稱:SharpLang,代碼行數:8,代碼來源:HttpListener2Test.cs

示例6: IsWindowsAuth

 public static bool IsWindowsAuth(AuthenticationSchemes authScheme)
 {
     if (authScheme != AuthenticationSchemes.Negotiate)
     {
         return (authScheme == AuthenticationSchemes.Ntlm);
     }
     return true;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:8,代碼來源:AuthenticationSchemesHelper.cs

示例7: HttpListener

        ArrayList wait_queue; // List<ListenerAsyncResult> wait_queue;

        public HttpListener ()
        {
            prefixes = new HttpListenerPrefixCollection (this);
            registry = new Hashtable ();
            ctx_queue = new ArrayList ();
            wait_queue = new ArrayList ();
            auth_schemes = AuthenticationSchemes.Anonymous;
        }
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:10,代碼來源:HttpListener.cs

示例8: HttpListener

 /// <summary>
 /// Initializes a new instance of the <see cref="HttpListener"/> class.
 /// </summary>
 public HttpListener ()
 {
   _authSchemes = AuthenticationSchemes.Anonymous;
   _connections = new Dictionary<HttpConnection, HttpConnection> ();
   _contextQueue = new List<HttpListenerContext> ();
   _prefixes = new HttpListenerPrefixCollection (this);
   _registry = new Dictionary<HttpListenerContext, HttpListenerContext> ();
   _waitQueue = new List<ListenerAsyncResult> ();
 }
開發者ID:songotony,項目名稱:RType-Client,代碼行數:12,代碼來源:HttpListener.cs

示例9: HttpListenerContext

 internal HttpListenerContext(HttpListener httpListener, RequestContextBase memoryBlob)
 {
     if (Logging.On) Logging.PrintInfo(Logging.HttpListener, this, ".ctor", "httpListener#" + ValidationHelper.HashString(httpListener) + " requestBlob=" + ValidationHelper.HashString((IntPtr) memoryBlob.RequestBlob));
     m_Listener = httpListener;
     m_Request = new HttpListenerRequest(this, memoryBlob);
     m_AuthenticationSchemes = httpListener.AuthenticationSchemes;
     m_ExtendedProtectionPolicy = httpListener.ExtendedProtectionPolicy;
     GlobalLog.Print("HttpListenerContext#" + ValidationHelper.HashString(this) + "::.ctor() HttpListener#" + ValidationHelper.HashString(m_Listener) + " HttpListenerRequest#" + ValidationHelper.HashString(m_Request));
 }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:9,代碼來源:HttpListenerContext.cs

示例10: HttpListener

 /// <summary>
 /// Initializes a new instance of the <see cref="HttpListener"/> class.
 /// </summary>
 public HttpListener()
 {
     prefixes     = new HttpListenerPrefixCollection (this);
     registry     = new Dictionary<HttpListenerContext, HttpListenerContext> ();
     connections  = new Dictionary<HttpConnection, HttpConnection> ();
     ctx_queue    = new List<HttpListenerContext> ();
     wait_queue   = new List<ListenerAsyncResult> ();
     auth_schemes = AuthenticationSchemes.Anonymous;
 }
開發者ID:kallex,項目名稱:websocket-sharp,代碼行數:12,代碼來源:HttpListener.cs

示例11: AuthenticationChallenge

 internal AuthenticationChallenge(AuthenticationSchemes scheme, string realm)
     : base(scheme, new NameValueCollection ())
 {
     Parameters["realm"] = realm;
       if (scheme == AuthenticationSchemes.Digest) {
     Parameters["nonce"] = CreateNonceValue ();
     Parameters["algorithm"] = "MD5";
     Parameters["qop"] = "auth";
       }
 }
開發者ID:pedro-ramirez-suarez,項目名稱:DiPS,代碼行數:10,代碼來源:AuthenticationChallenge.cs

示例12: Create

        public static WebhookServer Create(string url, Action<HttpListenerContext> handler, AuthenticationSchemes authenticationSchemes = AuthenticationSchemes.Anonymous)
        {
            var listener = new HttpListener
            {
                Prefixes = { url },
                AuthenticationSchemes = authenticationSchemes
            };
            var server = new WebhookServer(listener, handler);
            server.Start();
            return server;
        }
開發者ID:Sire,項目名稱:neteller-rest-api,代碼行數:11,代碼來源:WebhookServer.cs

示例13: HttpListener

        public HttpListener ()
        {
            prefixes = new HttpListenerPrefixCollection (this);
            registry = new Hashtable ();
            connections = Hashtable.Synchronized (new Hashtable ());
            ctx_queue = new ArrayList ();
            wait_queue = new ArrayList ();
            auth_schemes = AuthenticationSchemes.Anonymous;
            defaultServiceNames = new ServiceNameStore ();
            extendedProtectionPolicy = new ExtendedProtectionPolicy (PolicyEnforcement.Never);
        }
開發者ID:ItsVeryWindy,項目名稱:mono,代碼行數:11,代碼來源:HttpListener.cs

示例14: RtspSource

        public RtspSource(string name, string sourceLocation, NetworkCredential credential = null, AuthenticationSchemes authType = AuthenticationSchemes.None, Rtsp.RtspClient.ClientProtocolType? rtpProtocolType = null, int bufferSize = RtspClient.DefaultBufferSize, Sdp.MediaType? specificMedia = null, TimeSpan? startTime = null, TimeSpan? endTime = null)
            : this(name, new Uri(sourceLocation), credential, authType, rtpProtocolType, bufferSize, specificMedia, startTime, endTime)
        {
            //Check for a null Credential and UserInfo in the Location given.
            if (credential == null && !string.IsNullOrWhiteSpace(m_Source.UserInfo))
            {
                RtspClient.Credential = Media.Common.Extensions.Uri.UriExtensions.ParseUserInfo(m_Source);

                //Remove the user info from the location
                RtspClient.CurrentLocation = new Uri(RtspClient.CurrentLocation.AbsoluteUri.Replace(RtspClient.CurrentLocation.UserInfo + (char)Common.ASCII.AtSign, string.Empty).Replace(RtspClient.CurrentLocation.UserInfo, string.Empty));
            }
        }
開發者ID:qinpengit,項目名稱:net7mma-111212,代碼行數:12,代碼來源:RtspSource.cs

示例15: TryExtract

 public static bool TryExtract(BindingParameterCollection collection, out AuthenticationSchemes authenticationSchemes)
 {
     Fx.Assert(collection != null, "collection != null");
     authenticationSchemes = AuthenticationSchemes.None;
     AuthenticationSchemesBindingParameter instance = collection.Find<AuthenticationSchemesBindingParameter>();
     if (instance != null)
     {
         authenticationSchemes = instance.AuthenticationSchemes;
         return true;
     }
     return false;
 }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:12,代碼來源:AuthenticationSchemesBindingParameter.cs


注:本文中的AuthenticationSchemes類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。