Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / HttpClientCredentialType.cs / 1 / HttpClientCredentialType.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel { using System.Net; public enum HttpClientCredentialType { None, Basic, Digest, Ntlm, Windows, Certificate } static class HttpClientCredentialTypeHelper { internal static bool IsDefined(HttpClientCredentialType value) { return (value == HttpClientCredentialType.None || value == HttpClientCredentialType.Basic || value == HttpClientCredentialType.Digest || value == HttpClientCredentialType.Ntlm || value == HttpClientCredentialType.Windows || value == HttpClientCredentialType.Certificate); } internal static AuthenticationSchemes MapToAuthenticationScheme(HttpClientCredentialType clientCredentialType) { AuthenticationSchemes result; switch (clientCredentialType) { case HttpClientCredentialType.Certificate: // fall through to None case case HttpClientCredentialType.None: result = AuthenticationSchemes.Anonymous; break; case HttpClientCredentialType.Basic: result = AuthenticationSchemes.Basic; break; case HttpClientCredentialType.Digest: result = AuthenticationSchemes.Digest; break; case HttpClientCredentialType.Ntlm: result = AuthenticationSchemes.Ntlm; break; case HttpClientCredentialType.Windows: result = AuthenticationSchemes.Negotiate; break; default: DiagnosticUtility.DebugAssert("unsupported client credential type"); throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException()); } return result; } 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: DiagnosticUtility.DebugAssert("unsupported client AuthenticationScheme"); throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException()); } return result; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CodeTypeParameterCollection.cs
- Unit.cs
- SectionInput.cs
- Material.cs
- CultureInfoConverter.cs
- SiteMapProvider.cs
- EnumerableCollectionView.cs
- ConnectionStringsSection.cs
- Effect.cs
- mediapermission.cs
- PerspectiveCamera.cs
- BindingCompleteEventArgs.cs
- ContractNamespaceAttribute.cs
- SystemInfo.cs
- IIS7UserPrincipal.cs
- LOSFormatter.cs
- NameValuePair.cs
- HtmlShim.cs
- DbConnectionPool.cs
- SHA256Managed.cs
- Ref.cs
- SerializationEventsCache.cs
- GenericWebPart.cs
- BasicDesignerLoader.cs
- CqlIdentifiers.cs
- XmlNullResolver.cs
- AnimationTimeline.cs
- StateWorkerRequest.cs
- SettingsAttributeDictionary.cs
- SelectorAutomationPeer.cs
- InvalidateEvent.cs
- DecimalAnimationUsingKeyFrames.cs
- ProbeMatchesMessageCD1.cs
- CacheOutputQuery.cs
- FormViewDesigner.cs
- DynamicMethod.cs
- EntitySqlQueryCacheKey.cs
- DesignTimeDataBinding.cs
- Vector3DValueSerializer.cs
- AuthenticationConfig.cs
- FixedFindEngine.cs
- ConfigurationManagerHelper.cs
- ContainerSelectorGlyph.cs
- MenuStrip.cs
- EditorAttribute.cs
- KeyedQueue.cs
- ImageDrawing.cs
- MemoryFailPoint.cs
- Exceptions.cs
- XamlWrappingReader.cs
- NotifyInputEventArgs.cs
- WebPartConnectionsConfigureVerb.cs
- StylusPointPropertyInfoDefaults.cs
- TripleDESCryptoServiceProvider.cs
- WorkflowQueueInfo.cs
- TreeNodeSelectionProcessor.cs
- EntityDesignerBuildProvider.cs
- ServicePointManager.cs
- OverflowException.cs
- Exceptions.cs
- BitmapCodecInfoInternal.cs
- DataBoundControl.cs
- DependencyObject.cs
- SessionPageStateSection.cs
- FlowDecisionDesigner.xaml.cs
- SimpleFileLog.cs
- UnsafeNativeMethods.cs
- CryptoStream.cs
- FileLogRecordHeader.cs
- XmlSchemaElement.cs
- Page.cs
- HTMLTextWriter.cs
- SystemColors.cs
- Switch.cs
- HandledEventArgs.cs
- HostedBindingBehavior.cs
- UnionExpr.cs
- PageCache.cs
- WebControl.cs
- OpenCollectionAsyncResult.cs
- SystemPens.cs
- XmlSerializationReader.cs
- MSAAWinEventWrap.cs
- MethodResolver.cs
- UpdateProgress.cs
- SoapCodeExporter.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- BulletedListEventArgs.cs
- FixedMaxHeap.cs
- DocumentXPathNavigator.cs
- recordstatefactory.cs
- ActivityWithResultConverter.cs
- ChannelSinkStacks.cs
- QuaternionKeyFrameCollection.cs
- SessionStateContainer.cs
- OracleColumn.cs
- CodeMethodMap.cs
- FrameworkElement.cs
- IntPtr.cs
- Interlocked.cs