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
- ScaleTransform.cs
- AccessDataSourceView.cs
- X509ChainElement.cs
- DataGridViewColumnCollection.cs
- EventEntry.cs
- XLinq.cs
- GenerateHelper.cs
- CollectionExtensions.cs
- Int32Rect.cs
- SystemSounds.cs
- Setter.cs
- DataBoundLiteralControl.cs
- HttpServerProtocol.cs
- Membership.cs
- OutputScope.cs
- MonikerProxyAttribute.cs
- BindingCollection.cs
- HtmlImage.cs
- RelationshipConverter.cs
- XPathNodeList.cs
- UnknownWrapper.cs
- ToolStripPanelCell.cs
- ipaddressinformationcollection.cs
- PropertyValueChangedEvent.cs
- QilXmlReader.cs
- dataprotectionpermission.cs
- DataRowCollection.cs
- PostBackOptions.cs
- ConfigPathUtility.cs
- CurrentTimeZone.cs
- SqlDataSourceSelectingEventArgs.cs
- ElementFactory.cs
- XmlSchemaRedefine.cs
- DelegatingTypeDescriptionProvider.cs
- selecteditemcollection.cs
- Label.cs
- GridEntryCollection.cs
- PerfCounters.cs
- TypeUtil.cs
- StylusSystemGestureEventArgs.cs
- XMLSyntaxException.cs
- RowVisual.cs
- CapacityStreamGeometryContext.cs
- TdsValueSetter.cs
- DbReferenceCollection.cs
- StateItem.cs
- SiteMapNodeItemEventArgs.cs
- UTF8Encoding.cs
- RelatedImageListAttribute.cs
- StateFinalizationDesigner.cs
- XmlSerializableReader.cs
- CrossSiteScriptingValidation.cs
- FixedSchema.cs
- DecoderReplacementFallback.cs
- XmlCodeExporter.cs
- FontCacheUtil.cs
- VisualTreeUtils.cs
- Pair.cs
- SqlConnectionHelper.cs
- XPathNavigatorKeyComparer.cs
- XmlWellformedWriter.cs
- PopupEventArgs.cs
- DocumentPageView.cs
- CompensableActivity.cs
- NativeCompoundFileAPIs.cs
- ServiceChannelManager.cs
- DuplexChannel.cs
- HttpWrapper.cs
- IntegerValidator.cs
- FontConverter.cs
- ScriptingAuthenticationServiceSection.cs
- EventNotify.cs
- AttributeData.cs
- RadioButtonStandardAdapter.cs
- CategoryState.cs
- EntityContainer.cs
- SqlConnectionPoolGroupProviderInfo.cs
- AssemblyNameEqualityComparer.cs
- CroppedBitmap.cs
- ProfileEventArgs.cs
- CodeGenerator.cs
- ExpressionBinding.cs
- QilSortKey.cs
- IndexedGlyphRun.cs
- ZipFileInfo.cs
- HelpInfo.cs
- dsa.cs
- Group.cs
- LocalizedNameDescriptionPair.cs
- DeleteWorkflowOwnerCommand.cs
- MetadataArtifactLoader.cs
- ClonableStack.cs
- Metafile.cs
- VectorCollectionConverter.cs
- BeginStoryboard.cs
- ZipIOModeEnforcingStream.cs
- BufferModesCollection.cs
- LinqDataSourceDisposeEventArgs.cs
- CheckBoxField.cs
- GeometryCombineModeValidation.cs