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
- _NestedSingleAsyncResult.cs
- ConnectionPoint.cs
- TableLayoutCellPaintEventArgs.cs
- ReferenceService.cs
- Table.cs
- SettingsPropertyCollection.cs
- NullableBoolConverter.cs
- CheckoutException.cs
- BasePattern.cs
- TableRowCollection.cs
- oledbmetadatacolumnnames.cs
- xml.cs
- XmlSchemaInclude.cs
- ImageCodecInfoPrivate.cs
- NotConverter.cs
- XmlElementElement.cs
- prefixendpointaddressmessagefilter.cs
- PtsHost.cs
- XmlSchemaDocumentation.cs
- HttpInputStream.cs
- DataPagerFieldItem.cs
- BufferedGraphicsManager.cs
- UpdateExpressionVisitor.cs
- CodeCatchClause.cs
- SoapReflectionImporter.cs
- WebContentFormatHelper.cs
- MemberAccessException.cs
- TablePatternIdentifiers.cs
- PointUtil.cs
- ProofTokenCryptoHandle.cs
- DeflateStream.cs
- CfgArc.cs
- MTConfigUtil.cs
- BindingList.cs
- SqlRetyper.cs
- ErrorRuntimeConfig.cs
- DataTableCollection.cs
- JulianCalendar.cs
- AccessControlList.cs
- TimerEventSubscription.cs
- StickyNoteHelper.cs
- DataColumnCollection.cs
- DirectionalAction.cs
- FilterableAttribute.cs
- PointAnimationClockResource.cs
- TargetException.cs
- StateBag.cs
- VisualStateGroup.cs
- RegexCharClass.cs
- CodeArrayCreateExpression.cs
- IntSecurity.cs
- SmtpLoginAuthenticationModule.cs
- CryptoProvider.cs
- CorruptingExceptionCommon.cs
- XmlSiteMapProvider.cs
- XmlCompatibilityReader.cs
- mongolianshape.cs
- DataGridViewComboBoxCell.cs
- TextElement.cs
- _UriTypeConverter.cs
- ColorTransform.cs
- ObjectDataSourceView.cs
- WebFaultException.cs
- xdrvalidator.cs
- InfiniteTimeSpanConverter.cs
- DataTableMapping.cs
- XmlDocumentFragment.cs
- AttributeConverter.cs
- ChineseLunisolarCalendar.cs
- CompletionCallbackWrapper.cs
- UrlMapping.cs
- DetailsViewInsertEventArgs.cs
- DocumentReference.cs
- OrderPreservingPipeliningMergeHelper.cs
- SqlRecordBuffer.cs
- ListViewAutomationPeer.cs
- IsolatedStorageFile.cs
- ResourceDisplayNameAttribute.cs
- ArrangedElement.cs
- Base64Stream.cs
- DesignerResources.cs
- TabControlEvent.cs
- ReferencedType.cs
- FrameworkTemplate.cs
- EditorZone.cs
- HtmlTitle.cs
- LocalValueEnumerator.cs
- SqlDataReaderSmi.cs
- CompilerTypeWithParams.cs
- CompleteWizardStep.cs
- GlyphRun.cs
- WindowsListBox.cs
- XmlDeclaration.cs
- WriteableOnDemandStream.cs
- StrongNameUtility.cs
- FilteredXmlReader.cs
- XmlSiteMapProvider.cs
- OrderToken.cs
- AnnotationMap.cs
- PassportAuthenticationModule.cs