Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / IdentityModel / System / IdentityModel / Selectors / KerberosSecurityTokenProvider.cs / 1 / KerberosSecurityTokenProvider.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IdentityModel.Selectors { using System.IdentityModel.Tokens; using System.Security.Principal; using System.Net; public class KerberosSecurityTokenProvider : SecurityTokenProvider { string servicePrincipalName; TokenImpersonationLevel tokenImpersonationLevel; NetworkCredential networkCredential; public KerberosSecurityTokenProvider(string servicePrincipalName) : this(servicePrincipalName, TokenImpersonationLevel.Identification) { } public KerberosSecurityTokenProvider(string servicePrincipalName, TokenImpersonationLevel tokenImpersonationLevel) : this(servicePrincipalName, tokenImpersonationLevel, null) { } public KerberosSecurityTokenProvider(string servicePrincipalName, TokenImpersonationLevel tokenImpersonationLevel, NetworkCredential networkCredential) { if (servicePrincipalName == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("servicePrincipalName"); if (tokenImpersonationLevel != TokenImpersonationLevel.Identification && tokenImpersonationLevel != TokenImpersonationLevel.Impersonation) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("tokenImpersonationLevel", SR.GetString(SR.ImpersonationLevelNotSupported, tokenImpersonationLevel))); } this.servicePrincipalName = servicePrincipalName; this.tokenImpersonationLevel = tokenImpersonationLevel; this.networkCredential = networkCredential; } public string ServicePrincipalName { get { return this.servicePrincipalName; } } public TokenImpersonationLevel TokenImpersonationLevel { get { return this.tokenImpersonationLevel; } } public NetworkCredential NetworkCredential { get { return this.networkCredential; } } protected override SecurityToken GetTokenCore(TimeSpan timeout) { return new KerberosRequestorSecurityToken(this.servicePrincipalName, this.tokenImpersonationLevel, this.networkCredential, SecurityUniqueId.Create().Value); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XamlToRtfWriter.cs
- ApplicationHost.cs
- SqlEnums.cs
- CodeArgumentReferenceExpression.cs
- HttpsHostedTransportConfiguration.cs
- FollowerQueueCreator.cs
- RequestQueryProcessor.cs
- SystemIcons.cs
- SoapHeader.cs
- DuplicateDetector.cs
- XdrBuilder.cs
- DataTableReaderListener.cs
- HyperLinkStyle.cs
- SelectedDatesCollection.cs
- BufferedGraphics.cs
- followingsibling.cs
- DoubleLink.cs
- QilExpression.cs
- prefixendpointaddressmessagefiltertable.cs
- EventSetter.cs
- Memoizer.cs
- SynchronizedDisposablePool.cs
- DataColumnCollection.cs
- NetworkInformationException.cs
- ModelPropertyCollectionImpl.cs
- XPathScanner.cs
- RemotingConfigParser.cs
- OracleBFile.cs
- WindowHideOrCloseTracker.cs
- DataRecord.cs
- ListControlBuilder.cs
- QueryOperationResponseOfT.cs
- LinqExpressionNormalizer.cs
- SoapSchemaExporter.cs
- ProfileBuildProvider.cs
- CanExecuteRoutedEventArgs.cs
- ResourceExpressionBuilder.cs
- ResXResourceReader.cs
- SelectionListDesigner.cs
- PolyLineSegment.cs
- BooleanStorage.cs
- FixedSOMGroup.cs
- CodePageUtils.cs
- Triplet.cs
- DispatchOperationRuntime.cs
- FormsIdentity.cs
- WindowsScroll.cs
- Site.cs
- FloaterBaseParaClient.cs
- Viewport3DAutomationPeer.cs
- SafeSerializationManager.cs
- DataViewListener.cs
- PropertyTabChangedEvent.cs
- ObservableCollection.cs
- MessageQueueAccessControlEntry.cs
- CryptoProvider.cs
- PersonalizationDictionary.cs
- HttpException.cs
- TcpAppDomainProtocolHandler.cs
- GeometryDrawing.cs
- PropertyOverridesTypeEditor.cs
- SearchExpression.cs
- Array.cs
- CrossAppDomainChannel.cs
- TypeConverterHelper.cs
- ToolboxItemWrapper.cs
- DataGridViewElement.cs
- NetworkCredential.cs
- XpsDigitalSignature.cs
- StatusBarPanelClickEvent.cs
- BitmapEffectGeneralTransform.cs
- DateTimeUtil.cs
- ResourceManager.cs
- WebBrowser.cs
- HScrollBar.cs
- BuildProviderCollection.cs
- ListItemDetailViewAttribute.cs
- SecurityPermission.cs
- MD5CryptoServiceProvider.cs
- GradientStopCollection.cs
- XPathException.cs
- SqlInternalConnectionSmi.cs
- ArrayHelper.cs
- SystemResources.cs
- SecurityTokenContainer.cs
- DbDataAdapter.cs
- BindingFormattingDialog.cs
- ContractMapping.cs
- SplitterEvent.cs
- BamlWriter.cs
- VisualStyleElement.cs
- securitycriticaldataClass.cs
- CharEnumerator.cs
- InvokePattern.cs
- AnnotationHelper.cs
- AuthenticationConfig.cs
- StorageInfo.cs
- BitSet.cs
- ScriptingProfileServiceSection.cs
- XPathNode.cs