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
- Terminate.cs
- PropertyTabAttribute.cs
- ECDsaCng.cs
- SHA512.cs
- HandleCollector.cs
- SemaphoreFullException.cs
- CreateUserWizardStep.cs
- COM2TypeInfoProcessor.cs
- HwndHostAutomationPeer.cs
- Style.cs
- TextContainerChangeEventArgs.cs
- RelationshipNavigation.cs
- _ShellExpression.cs
- BooleanAnimationBase.cs
- BuildResult.cs
- TypefaceCollection.cs
- UniqueConstraint.cs
- FocusChangedEventArgs.cs
- SchemaInfo.cs
- PageAction.cs
- PerformanceCounterPermissionEntryCollection.cs
- PageSetupDialog.cs
- NullableFloatSumAggregationOperator.cs
- DiagnosticsConfiguration.cs
- Types.cs
- XmlSchemaSearchPattern.cs
- FrameworkContentElementAutomationPeer.cs
- ColumnMapTranslator.cs
- CollectionsUtil.cs
- AndCondition.cs
- RouteItem.cs
- RootDesignerSerializerAttribute.cs
- InfoCardMetadataExchangeClient.cs
- CdpEqualityComparer.cs
- RawStylusInput.cs
- TargetConverter.cs
- InfoCardAsymmetricCrypto.cs
- ClientSideProviderDescription.cs
- DelegateCompletionCallbackWrapper.cs
- ConstraintStruct.cs
- HttpDebugHandler.cs
- grammarelement.cs
- XsdBuildProvider.cs
- DataGridView.cs
- RewritingPass.cs
- ScriptHandlerFactory.cs
- GridViewSelectEventArgs.cs
- IntegerFacetDescriptionElement.cs
- RemotingSurrogateSelector.cs
- SystemPens.cs
- SqlResolver.cs
- EventManager.cs
- TemplatedWizardStep.cs
- Util.cs
- EncryptedData.cs
- AnalyzedTree.cs
- ObjectConverter.cs
- XmlDocumentType.cs
- SpeechSeg.cs
- Control.cs
- ConfigErrorGlyph.cs
- Component.cs
- SignatureConfirmationElement.cs
- TagPrefixCollection.cs
- XmlILStorageConverter.cs
- XmlDataDocument.cs
- CqlParser.cs
- XmlDataDocument.cs
- MyContact.cs
- ProtocolsConfiguration.cs
- InternalResources.cs
- PreservationFileWriter.cs
- UpdatePanelTriggerCollection.cs
- WebMessageFormatHelper.cs
- PointAnimationBase.cs
- AdornerDecorator.cs
- PointLight.cs
- SmtpFailedRecipientsException.cs
- CopyAttributesAction.cs
- FixedNode.cs
- ProviderManager.cs
- ChtmlCalendarAdapter.cs
- KeySpline.cs
- CodeExpressionStatement.cs
- StsCommunicationException.cs
- XmlSchemaProviderAttribute.cs
- Vector3DAnimation.cs
- AlphaSortedEnumConverter.cs
- Point4DValueSerializer.cs
- SQLInt16.cs
- TextProviderWrapper.cs
- CharacterHit.cs
- WrappedIUnknown.cs
- SizeIndependentAnimationStorage.cs
- RemoveStoryboard.cs
- PageFunction.cs
- MessageBox.cs
- TreeNodeStyle.cs
- LZCodec.cs
- BaseParagraph.cs