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
- Panel.cs
- DrawingVisual.cs
- TokenBasedSetEnumerator.cs
- ArglessEventHandlerProxy.cs
- serverconfig.cs
- DelegateSerializationHolder.cs
- WebPartManager.cs
- DrawTreeNodeEventArgs.cs
- SafeBitVector32.cs
- GetPageCompletedEventArgs.cs
- RuntimeCompatibilityAttribute.cs
- securestring.cs
- FactoryRecord.cs
- DiagnosticsConfigurationHandler.cs
- CodeIdentifiers.cs
- FileChangesMonitor.cs
- IdentityReference.cs
- GradientStop.cs
- EndpointNameMessageFilter.cs
- coordinator.cs
- MimePart.cs
- SkipStoryboardToFill.cs
- SettingsPropertyWrongTypeException.cs
- ProfileEventArgs.cs
- ContextMenu.cs
- BinaryFormatterWriter.cs
- xsdvalidator.cs
- DirectoryObjectSecurity.cs
- CaseStatement.cs
- BasicBrowserDialog.cs
- ClientBuildManager.cs
- TraceRecord.cs
- Atom10FormatterFactory.cs
- XPathEmptyIterator.cs
- CqlIdentifiers.cs
- DynamicRouteExpression.cs
- GridViewColumn.cs
- ServiceParser.cs
- StylusDevice.cs
- Compiler.cs
- XmlAttributeAttribute.cs
- CapabilitiesUse.cs
- Stacktrace.cs
- ServerIdentity.cs
- InvalidOperationException.cs
- MethodAccessException.cs
- DrawingCollection.cs
- ToolstripProfessionalRenderer.cs
- StretchValidation.cs
- NotifyInputEventArgs.cs
- RijndaelManaged.cs
- NumberFunctions.cs
- RealProxy.cs
- DiscoveryDocumentReference.cs
- TextServicesContext.cs
- SynchronizingStream.cs
- SourceCollection.cs
- FormatStringEditor.cs
- InternalBase.cs
- XmlSchemaImport.cs
- ThrowHelper.cs
- TypeToken.cs
- CompiledQueryCacheKey.cs
- XmlHelper.cs
- AppDomainUnloadedException.cs
- TextRunCacheImp.cs
- ColumnMapCopier.cs
- EncodingTable.cs
- ValidationError.cs
- _ContextAwareResult.cs
- ConnectionStringsSection.cs
- Point4DValueSerializer.cs
- PropertySourceInfo.cs
- ComponentDispatcher.cs
- DispatcherTimer.cs
- Geometry3D.cs
- SimplePropertyEntry.cs
- PropVariant.cs
- ClientFactory.cs
- XmlTextReader.cs
- DataDocumentXPathNavigator.cs
- ReachPageContentSerializerAsync.cs
- ItemsControlAutomationPeer.cs
- MemberInfoSerializationHolder.cs
- DataObjectPastingEventArgs.cs
- TextProperties.cs
- XmlAtomicValue.cs
- XMLUtil.cs
- TypeBuilderInstantiation.cs
- NestedContainer.cs
- PropertyTabChangedEvent.cs
- CodeParameterDeclarationExpression.cs
- DataGridTextBoxColumn.cs
- TextElementEnumerator.cs
- IItemContainerGenerator.cs
- ValueUnavailableException.cs
- StyleReferenceConverter.cs
- Vector3DAnimationBase.cs
- DocumentViewer.cs
- XNodeSchemaApplier.cs