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

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DispatchWrapper.cs
- TransformConverter.cs
- DbRetry.cs
- GeneralTransform3DTo2D.cs
- ScriptingSectionGroup.cs
- FormViewModeEventArgs.cs
- ImageMapEventArgs.cs
- SolidBrush.cs
- ThreadAttributes.cs
- MemoryRecordBuffer.cs
- UITypeEditor.cs
- BoundField.cs
- TransformerInfoCollection.cs
- DrawingState.cs
- SignedXml.cs
- Emitter.cs
- PopOutPanel.cs
- ButtonBaseAdapter.cs
- SqlConnectionPoolProviderInfo.cs
- XmlNode.cs
- KeySplineConverter.cs
- WebPartTransformer.cs
- TabControlToolboxItem.cs
- TextBox.cs
- MulticastOption.cs
- StickyNote.cs
- ImageIndexConverter.cs
- FontClient.cs
- DictionaryManager.cs
- TransactionsSectionGroup.cs
- BitStream.cs
- WriteTimeStream.cs
- TableRowCollection.cs
- ReadOnlyDataSourceView.cs
- IPAddress.cs
- DataObjectEventArgs.cs
- NavigationPropertyEmitter.cs
- ListViewItemEventArgs.cs
- Formatter.cs
- RecommendedAsConfigurableAttribute.cs
- GB18030Encoding.cs
- XmlAttributeAttribute.cs
- CheckBox.cs
- EntityWrapper.cs
- TemplateContent.cs
- InputMethodStateTypeInfo.cs
- WebExceptionStatus.cs
- AxHostDesigner.cs
- COM2FontConverter.cs
- SoapFault.cs
- PersistenceException.cs
- XpsFixedDocumentSequenceReaderWriter.cs
- DelegatingHeader.cs
- ResourcePermissionBase.cs
- JsonWriterDelegator.cs
- PerformanceCounters.cs
- ResourceWriter.cs
- Number.cs
- DynamicDataRoute.cs
- UserNameSecurityTokenParameters.cs
- UInt16Converter.cs
- MenuItemBinding.cs
- GeneralTransform.cs
- RowType.cs
- MemberProjectionIndex.cs
- TrackingDataItem.cs
- PEFileEvidenceFactory.cs
- HtmlMeta.cs
- IsolationInterop.cs
- HitTestParameters.cs
- FixedDocument.cs
- XmlSchemaSimpleTypeRestriction.cs
- ModelUtilities.cs
- ComplexObject.cs
- ToolStripScrollButton.cs
- TextEditorCharacters.cs
- PackageDigitalSignature.cs
- ListViewCommandEventArgs.cs
- TextControl.cs
- HMACSHA256.cs
- DecoderExceptionFallback.cs
- DeflateEmulationStream.cs
- DirtyTextRange.cs
- BindingEntityInfo.cs
- PtsHelper.cs
- UriTemplateTrieLocation.cs
- PageAdapter.cs
- UpDownEvent.cs
- ObjectDataSourceEventArgs.cs
- Win32.cs
- Listen.cs
- CollectionConverter.cs
- AdjustableArrowCap.cs
- DocumentGrid.cs
- Frame.cs
- SecUtil.cs
- SystemWebSectionGroup.cs
- InitiatorSessionSymmetricTransportSecurityProtocol.cs
- PlaceHolder.cs
- CacheSection.cs