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
- ResourceContainer.cs
- HTMLTagNameToTypeMapper.cs
- BoolExpressionVisitors.cs
- Int32.cs
- DBSchemaTable.cs
- TextRunTypographyProperties.cs
- RenderTargetBitmap.cs
- cookie.cs
- BitmapVisualManager.cs
- Exceptions.cs
- DynamicPropertyHolder.cs
- TextTreeTextBlock.cs
- ToolStripPanelCell.cs
- ClientViaElement.cs
- AutoFocusStyle.xaml.cs
- SQLDateTimeStorage.cs
- DbXmlEnabledProviderManifest.cs
- IgnoreDataMemberAttribute.cs
- DecimalFormatter.cs
- DataGridTable.cs
- WCFServiceClientProxyGenerator.cs
- InvalidWMPVersionException.cs
- Polyline.cs
- SqlDuplicator.cs
- FixedSOMImage.cs
- NetworkInformationPermission.cs
- SessionIDManager.cs
- JsonClassDataContract.cs
- DateTimeStorage.cs
- CellNormalizer.cs
- MemoryRecordBuffer.cs
- SoapIncludeAttribute.cs
- Rotation3D.cs
- ActivityTypeResolver.xaml.cs
- MimeParameter.cs
- HtmlGenericControl.cs
- SqlMethods.cs
- TableLayoutCellPaintEventArgs.cs
- ModelItemImpl.cs
- UserNameSecurityTokenAuthenticator.cs
- EventMappingSettingsCollection.cs
- UniqueEventHelper.cs
- KerberosRequestorSecurityToken.cs
- Animatable.cs
- CanonicalXml.cs
- VisualStyleRenderer.cs
- Rectangle.cs
- SemanticKeyElement.cs
- CloseCryptoHandleRequest.cs
- ConfigurationHelpers.cs
- XsdSchemaFileEditor.cs
- DataGridViewRowsAddedEventArgs.cs
- ComboBox.cs
- ClientSettings.cs
- TouchDevice.cs
- DataObjectEventArgs.cs
- RepeaterItemCollection.cs
- GetPageNumberCompletedEventArgs.cs
- EntityConnectionStringBuilderItem.cs
- ResourceAssociationType.cs
- BulletDecorator.cs
- PrintControllerWithStatusDialog.cs
- ReceiveSecurityHeader.cs
- DataObjectAttribute.cs
- UInt32Storage.cs
- XamlTemplateSerializer.cs
- DomNameTable.cs
- XDRSchema.cs
- ComponentCommands.cs
- InstanceValue.cs
- XmlSchemaIdentityConstraint.cs
- NetSectionGroup.cs
- RelatedPropertyManager.cs
- SnapshotChangeTrackingStrategy.cs
- Compiler.cs
- XPathAncestorQuery.cs
- XmlQueryStaticData.cs
- AlphabeticalEnumConverter.cs
- FamilyMapCollection.cs
- codemethodreferenceexpression.cs
- CharAnimationUsingKeyFrames.cs
- DataStreams.cs
- DiagnosticTraceSource.cs
- TypeLoadException.cs
- SettingsAttributes.cs
- ObjectComplexPropertyMapping.cs
- XamlBuildProvider.cs
- mansign.cs
- DirectoryGroupQuery.cs
- NetworkAddressChange.cs
- XmlElementAttribute.cs
- _UriTypeConverter.cs
- SocketElement.cs
- SimpleRecyclingCache.cs
- FrameworkContentElement.cs
- SessionEndingCancelEventArgs.cs
- EntityDesignerBuildProvider.cs
- WebControlAdapter.cs
- FilterFactory.cs
- LinqDataSourceStatusEventArgs.cs