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
- SystemPens.cs
- XmlDictionaryReaderQuotasElement.cs
- ConfigPathUtility.cs
- CreateUserErrorEventArgs.cs
- QilParameter.cs
- TableStyle.cs
- UserValidatedEventArgs.cs
- TextBounds.cs
- ZipIOExtraFieldPaddingElement.cs
- EventBuilder.cs
- MenuEventArgs.cs
- TypeResolver.cs
- DataGridViewCellValueEventArgs.cs
- FocusChangedEventArgs.cs
- XmlUtf8RawTextWriter.cs
- InkCanvasSelection.cs
- SerializationFieldInfo.cs
- TraceContextEventArgs.cs
- AtomicFile.cs
- XamlReader.cs
- X509Extension.cs
- WebPartTransformerCollection.cs
- dataprotectionpermission.cs
- BindingManagerDataErrorEventArgs.cs
- CounterCreationDataCollection.cs
- SimpleRecyclingCache.cs
- MarkupCompilePass1.cs
- TileBrush.cs
- GridViewUpdatedEventArgs.cs
- NonClientArea.cs
- XmlHierarchyData.cs
- XmlBoundElement.cs
- RangeContentEnumerator.cs
- Point4DValueSerializer.cs
- StorageEntitySetMapping.cs
- EnumMember.cs
- DeclaredTypeValidatorAttribute.cs
- XmlLoader.cs
- FirstMatchCodeGroup.cs
- ComplexTypeEmitter.cs
- IndentedWriter.cs
- ToolStripItemRenderEventArgs.cs
- ReadOnlyDictionary.cs
- Interlocked.cs
- XmlConvert.cs
- DESCryptoServiceProvider.cs
- returneventsaver.cs
- BindableTemplateBuilder.cs
- StrokeNode.cs
- BlobPersonalizationState.cs
- NativeMethods.cs
- TabletCollection.cs
- ImageAnimator.cs
- EmbeddedMailObject.cs
- HttpPostServerProtocol.cs
- CodeGenerator.cs
- ScriptResourceInfo.cs
- WCFServiceClientProxyGenerator.cs
- KeyedByTypeCollection.cs
- IChannel.cs
- EntityDataSourceWrapper.cs
- ContentDefinition.cs
- Figure.cs
- SelectorAutomationPeer.cs
- RecipientIdentity.cs
- DiscreteKeyFrames.cs
- ColorDialog.cs
- CompressStream.cs
- SystemGatewayIPAddressInformation.cs
- SystemIcons.cs
- arc.cs
- UnionQueryOperator.cs
- ActivityCodeDomSerializer.cs
- DeviceContext2.cs
- Errors.cs
- Timer.cs
- Point3DAnimation.cs
- Soap.cs
- RegexReplacement.cs
- XPathParser.cs
- OdbcConnectionHandle.cs
- CellLabel.cs
- TextBoxAutoCompleteSourceConverter.cs
- EditableRegion.cs
- LinearQuaternionKeyFrame.cs
- TableLayoutStyle.cs
- RepeaterItemCollection.cs
- Predicate.cs
- FlowLayoutPanelDesigner.cs
- WindowsAltTab.cs
- ProgressBarBrushConverter.cs
- TimelineGroup.cs
- XhtmlBasicLinkAdapter.cs
- ToolstripProfessionalRenderer.cs
- WorkflowMessageEventHandler.cs
- BuildResultCache.cs
- Content.cs
- Completion.cs
- EnumBuilder.cs
- ThicknessKeyFrameCollection.cs