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
- SystemIPGlobalStatistics.cs
- Set.cs
- MatrixKeyFrameCollection.cs
- AutomationElementIdentifiers.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- WebBrowserDocumentCompletedEventHandler.cs
- FilteredDataSetHelper.cs
- RewritingSimplifier.cs
- PartialCachingAttribute.cs
- odbcmetadatacolumnnames.cs
- DelegatedStream.cs
- ParallelLoopState.cs
- BookmarkInfo.cs
- QilXmlWriter.cs
- EntityCommand.cs
- Accessible.cs
- MediaTimeline.cs
- XmlWrappingReader.cs
- AssemblyContextControlItem.cs
- OneToOneMappingSerializer.cs
- UndoEngine.cs
- ListViewGroupConverter.cs
- RawStylusInputReport.cs
- VisualTarget.cs
- ChildDocumentBlock.cs
- ProcessThread.cs
- SmiMetaDataProperty.cs
- CodeTypeParameter.cs
- TreeView.cs
- FilteredDataSetHelper.cs
- XsltArgumentList.cs
- CategoryGridEntry.cs
- TextOutput.cs
- XmlSchemaInclude.cs
- IRCollection.cs
- CompressedStack.cs
- OutOfProcStateClientManager.cs
- DBNull.cs
- XmlDataImplementation.cs
- Oid.cs
- EntityStoreSchemaFilterEntry.cs
- ClientFormsAuthenticationCredentials.cs
- ComplexPropertyEntry.cs
- followingsibling.cs
- MetadataItem.cs
- KeyConverter.cs
- ObservableCollection.cs
- DataGridViewEditingControlShowingEventArgs.cs
- ResizingMessageFilter.cs
- ArcSegment.cs
- ParentControlDesigner.cs
- RootContext.cs
- PriorityChain.cs
- DateTimePicker.cs
- TemplateControlParser.cs
- IdentityReference.cs
- BinHexDecoder.cs
- SevenBitStream.cs
- MenuTracker.cs
- DesignerVerbCollection.cs
- WebMessageEncodingBindingElement.cs
- ConstraintStruct.cs
- CheckBoxFlatAdapter.cs
- NavigationPropertyEmitter.cs
- WebPartManager.cs
- IfAction.cs
- NullableDecimalAverageAggregationOperator.cs
- SafeEventLogWriteHandle.cs
- WebControl.cs
- PinnedBufferMemoryStream.cs
- AutoGeneratedField.cs
- Vector3DCollection.cs
- _CommandStream.cs
- DialogResultConverter.cs
- XmlText.cs
- RangeValuePatternIdentifiers.cs
- ObjectListCommandsPage.cs
- ExtractorMetadata.cs
- SoapProtocolImporter.cs
- AcceleratedTokenProvider.cs
- Executor.cs
- TableLayoutStyleCollection.cs
- processwaithandle.cs
- ReachSerializationUtils.cs
- CodeDelegateCreateExpression.cs
- PathSegment.cs
- XsdBuildProvider.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- HttpCachePolicy.cs
- LinkLabelLinkClickedEvent.cs
- JavaScriptObjectDeserializer.cs
- FontFamily.cs
- MultiSelector.cs
- ClientConvert.cs
- EntityViewContainer.cs
- VolatileEnlistmentMultiplexing.cs
- ToolStripContainer.cs
- EntityDataSourceDataSelection.cs
- BuildResultCache.cs
- RequestQueue.cs