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
- ReaderWriterLock.cs
- CultureInfo.cs
- WebPartHeaderCloseVerb.cs
- Peer.cs
- OleTxTransactionInfo.cs
- XComponentModel.cs
- LoginCancelEventArgs.cs
- DbDeleteCommandTree.cs
- DataControlLinkButton.cs
- InputReport.cs
- WindowsEditBox.cs
- UniqueIdentifierService.cs
- FunctionQuery.cs
- SessionIDManager.cs
- SizeValueSerializer.cs
- VerificationAttribute.cs
- ZipQueryOperator.cs
- Camera.cs
- assemblycache.cs
- XsdCachingReader.cs
- OracleRowUpdatingEventArgs.cs
- TargetInvocationException.cs
- SystemSounds.cs
- loginstatus.cs
- XmlLinkedNode.cs
- XmlSchemaIdentityConstraint.cs
- formatter.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- SqlBulkCopy.cs
- EncryptedXml.cs
- SiteMapNodeCollection.cs
- WebPartRestoreVerb.cs
- BitmapFrameDecode.cs
- GridViewUpdateEventArgs.cs
- EnglishPluralizationService.cs
- FactorySettingsElement.cs
- InlineCategoriesDocument.cs
- Invariant.cs
- XmlParserContext.cs
- ContentIterators.cs
- CrossSiteScriptingValidation.cs
- XamlGridLengthSerializer.cs
- SecurityResources.cs
- XmlAttributeHolder.cs
- UnsafeNativeMethods.cs
- TrackingMemoryStream.cs
- MenuAdapter.cs
- ProcessThreadCollection.cs
- DataGridViewAdvancedBorderStyle.cs
- NamedPipeChannelFactory.cs
- EventLogTraceListener.cs
- InitializationEventAttribute.cs
- OleDbException.cs
- Tag.cs
- DispatchChannelSink.cs
- SchemaNames.cs
- PasswordDeriveBytes.cs
- NonDualMessageSecurityOverHttpElement.cs
- XmlSchemaGroup.cs
- _SSPISessionCache.cs
- _OverlappedAsyncResult.cs
- CompositeControl.cs
- Evidence.cs
- CodeExpressionStatement.cs
- ExtensionWindow.cs
- ImageList.cs
- ValidationHelper.cs
- HMACSHA256.cs
- StorageInfo.cs
- SoapCodeExporter.cs
- HtmlInputSubmit.cs
- objectquery_tresulttype.cs
- WindowCollection.cs
- ReflectEventDescriptor.cs
- ConnectionInterfaceCollection.cs
- Domain.cs
- CompositeDataBoundControl.cs
- CounterSample.cs
- Tracking.cs
- ImageListImageEditor.cs
- CodeTypeReference.cs
- UmAlQuraCalendar.cs
- PagerSettings.cs
- ApplicationSecurityManager.cs
- TypeConverterAttribute.cs
- ZipIOModeEnforcingStream.cs
- DesignerMetadata.cs
- FixedSOMPage.cs
- WbmpConverter.cs
- X509CertificateCollection.cs
- GenerateScriptTypeAttribute.cs
- XmlAttributeCache.cs
- Pens.cs
- ColorInterpolationModeValidation.cs
- GlyphElement.cs
- _IPv6Address.cs
- ScriptResourceHandler.cs
- RelatedImageListAttribute.cs
- ResXResourceSet.cs
- DataServiceExpressionVisitor.cs