Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / IdentityModel / System / IdentityModel / Selectors / KerberosSecurityTokenProvider.cs / 1305376 / KerberosSecurityTokenProvider.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IdentityModel.Selectors { using System.IdentityModel.Tokens; using System.Net; using System.Security.Authentication.ExtendedProtection; using System.Security.Principal; 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; } } internal SecurityToken GetToken(TimeSpan timeout, ChannelBinding channelbinding) { return new KerberosRequestorSecurityToken(this.ServicePrincipalName, this.TokenImpersonationLevel, this.NetworkCredential, SecurityUniqueId.Create().Value, channelbinding); } protected override SecurityToken GetTokenCore(TimeSpan timeout) { return this.GetToken(timeout, null); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- OleDbPropertySetGuid.cs
- _IPv4Address.cs
- Rights.cs
- DebugView.cs
- FlowLayout.cs
- ParamArrayAttribute.cs
- HostingPreferredMapPath.cs
- ClosureBinding.cs
- StateWorkerRequest.cs
- altserialization.cs
- ClientFormsAuthenticationMembershipProvider.cs
- RouteItem.cs
- LoadWorkflowAsyncResult.cs
- validation.cs
- Page.cs
- Console.cs
- TextAdaptor.cs
- EncoderFallback.cs
- FileResponseElement.cs
- Attributes.cs
- HatchBrush.cs
- LoggedException.cs
- LineGeometry.cs
- xdrvalidator.cs
- QuestionEventArgs.cs
- LineServices.cs
- SqlStatistics.cs
- ColorTransformHelper.cs
- HostedHttpContext.cs
- FixedPageStructure.cs
- CannotUnloadAppDomainException.cs
- ToolStripMenuItem.cs
- ColumnCollectionEditor.cs
- TrackingRecordPreFilter.cs
- StartUpEventArgs.cs
- EnterpriseServicesHelper.cs
- MessageSecurityOverTcp.cs
- _ProxyRegBlob.cs
- HtmlMeta.cs
- SecurityDescriptor.cs
- LightweightCodeGenerator.cs
- StringCollection.cs
- RichTextBox.cs
- PolicyUnit.cs
- StrongNameIdentityPermission.cs
- ClockController.cs
- MLangCodePageEncoding.cs
- UndoEngine.cs
- BypassElement.cs
- ConsumerConnectionPointCollection.cs
- TextBox.cs
- Light.cs
- StatusBarPanel.cs
- DataPagerCommandEventArgs.cs
- Stack.cs
- MenuScrollingVisibilityConverter.cs
- ErrorTableItemStyle.cs
- FixedHighlight.cs
- OciLobLocator.cs
- OleDbConnectionFactory.cs
- SessionStateUtil.cs
- PathFigureCollectionValueSerializer.cs
- WeakReferenceList.cs
- SystemNetworkInterface.cs
- SoapObjectReader.cs
- ContextBase.cs
- SafeCryptContextHandle.cs
- HttpUnhandledOperationInvoker.cs
- Util.cs
- UIElementAutomationPeer.cs
- X509CertificateValidationMode.cs
- PreviewKeyDownEventArgs.cs
- CustomError.cs
- _BufferOffsetSize.cs
- HttpCapabilitiesBase.cs
- ObjectHandle.cs
- documentsequencetextcontainer.cs
- SchemaAttDef.cs
- TableLayoutPanelDesigner.cs
- DocumentApplicationDocumentViewer.cs
- XmlAttributeAttribute.cs
- CorrelationToken.cs
- BatchServiceHost.cs
- CannotUnloadAppDomainException.cs
- TypeConverterMarkupExtension.cs
- LinqDataSourceInsertEventArgs.cs
- OleDbInfoMessageEvent.cs
- DynamicValidator.cs
- PolygonHotSpot.cs
- UIAgentAsyncBeginRequest.cs
- HMACSHA256.cs
- VectorCollection.cs
- NullableIntSumAggregationOperator.cs
- OdbcStatementHandle.cs
- IconConverter.cs
- CuspData.cs
- SrgsToken.cs
- DataGridViewCellPaintingEventArgs.cs
- Positioning.cs
- Logging.cs