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
- SqlStream.cs
- Highlights.cs
- DaylightTime.cs
- DbProviderFactoriesConfigurationHandler.cs
- Crc32.cs
- SubtreeProcessor.cs
- TypedTableHandler.cs
- BuiltInExpr.cs
- TargetFrameworkUtil.cs
- JsonSerializer.cs
- TextPatternIdentifiers.cs
- PersonalizableTypeEntry.cs
- SqlXmlStorage.cs
- ProbeRequestResponseAsyncResult.cs
- DescendantBaseQuery.cs
- SynchronizationLockException.cs
- FixedHyperLink.cs
- RowToFieldTransformer.cs
- XpsSerializationException.cs
- XmlTextAttribute.cs
- DesignerResources.cs
- CommandTreeTypeHelper.cs
- DateTimeHelper.cs
- BidirectionalDictionary.cs
- sitestring.cs
- ZipIOLocalFileDataDescriptor.cs
- TimeoutHelper.cs
- Rights.cs
- HeaderUtility.cs
- GcSettings.cs
- OleDbInfoMessageEvent.cs
- RegistrationContext.cs
- PropertyCondition.cs
- DetailsView.cs
- IndentTextWriter.cs
- Queue.cs
- AlignmentYValidation.cs
- VarRemapper.cs
- TableColumn.cs
- SlipBehavior.cs
- GlyphRunDrawing.cs
- DataGridPageChangedEventArgs.cs
- BindUriHelper.cs
- RelatedEnd.cs
- LinkedResourceCollection.cs
- MimeMapping.cs
- FormViewModeEventArgs.cs
- ComboBoxHelper.cs
- BookmarkEventArgs.cs
- UndirectedGraph.cs
- Attributes.cs
- FloatSumAggregationOperator.cs
- XhtmlBasicObjectListAdapter.cs
- EncryptedReference.cs
- SqlGatherProducedAliases.cs
- BufferedWebEventProvider.cs
- XmlAttributeHolder.cs
- ForeignKeyConstraint.cs
- CompressedStack.cs
- ConfigurationStrings.cs
- FileDataSourceCache.cs
- InProcStateClientManager.cs
- DataGridTextBoxColumn.cs
- DateTimePicker.cs
- XsdBuildProvider.cs
- BitmapFrameEncode.cs
- AmbientProperties.cs
- Reference.cs
- ClientTargetCollection.cs
- DnsEndPoint.cs
- SocketConnection.cs
- TextDecoration.cs
- DeleteIndexBinder.cs
- ScriptManager.cs
- ItemType.cs
- GACIdentityPermission.cs
- PageBuildProvider.cs
- ListViewGroup.cs
- SessionPageStateSection.cs
- DataTableNewRowEvent.cs
- EncodedStreamFactory.cs
- HttpException.cs
- DesignerActionTextItem.cs
- TagPrefixAttribute.cs
- Query.cs
- EncodingInfo.cs
- UniqueIdentifierService.cs
- shaperfactoryquerycacheentry.cs
- LinkTarget.cs
- CodeSnippetStatement.cs
- unitconverter.cs
- ProgressiveCrcCalculatingStream.cs
- GridViewCancelEditEventArgs.cs
- GCHandleCookieTable.cs
- ServiceReflector.cs
- XmlTextAttribute.cs
- SizeAnimationUsingKeyFrames.cs
- EntityContainer.cs
- TreeChangeInfo.cs
- SessionIDManager.cs