本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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> ();
}
示例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));
}
示例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;
}
示例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";
}
}
示例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;
}
示例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);
}
示例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));
}
}
示例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;
}