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
- Win32Native.cs
- ExtensionDataReader.cs
- NameObjectCollectionBase.cs
- IRCollection.cs
- HTTPNotFoundHandler.cs
- Codec.cs
- SymbolTable.cs
- XamlToRtfWriter.cs
- OleDbPropertySetGuid.cs
- ServiceModelStringsVersion1.cs
- log.cs
- X509Certificate2Collection.cs
- AsyncContentLoadedEventArgs.cs
- Collection.cs
- formatter.cs
- PropertyMapper.cs
- XPathNode.cs
- InstanceData.cs
- TypeSystemProvider.cs
- WebPartHelpVerb.cs
- XmlQualifiedNameTest.cs
- Token.cs
- DiscoveryServerProtocol.cs
- UnsafeNativeMethods.cs
- FrameworkTextComposition.cs
- UseLicense.cs
- DesignerSerializationOptionsAttribute.cs
- GroupStyle.cs
- XmlSerializerNamespaces.cs
- DataGridDetailsPresenter.cs
- RuntimeConfig.cs
- ReversePositionQuery.cs
- XmlILModule.cs
- _SslSessionsCache.cs
- ConfigPathUtility.cs
- ItemDragEvent.cs
- StreamingContext.cs
- BufferedGraphics.cs
- ConstantSlot.cs
- DeflateStream.cs
- BitVector32.cs
- ThicknessAnimationBase.cs
- TypeConverterHelper.cs
- XsltLibrary.cs
- InstanceDescriptor.cs
- JapaneseCalendar.cs
- ResourceSet.cs
- SizeChangedEventArgs.cs
- XmlWrappingReader.cs
- AuthenticationException.cs
- VisualTreeUtils.cs
- PointHitTestParameters.cs
- EmptyCollection.cs
- WorkflowApplication.cs
- TimerEventSubscriptionCollection.cs
- TcpAppDomainProtocolHandler.cs
- FrameworkElement.cs
- CompilerTypeWithParams.cs
- CredentialManagerDialog.cs
- SinglePageViewer.cs
- formatter.cs
- Vector3DCollectionValueSerializer.cs
- ProxyAttribute.cs
- OracleInfoMessageEventArgs.cs
- DeviceSpecificChoice.cs
- SQLByteStorage.cs
- SerializationSectionGroup.cs
- SessionStateItemCollection.cs
- DockProviderWrapper.cs
- FileEnumerator.cs
- IsolatedStorageFileStream.cs
- TraceSection.cs
- Vector3D.cs
- DirectoryLocalQuery.cs
- oledbconnectionstring.cs
- RadioButtonPopupAdapter.cs
- XmlSchemaExternal.cs
- DataGridViewTextBoxColumn.cs
- SimpleExpression.cs
- ToolStripItemEventArgs.cs
- ContractType.cs
- Point4D.cs
- SoundPlayerAction.cs
- XmlLanguageConverter.cs
- SafeFileHandle.cs
- WebScriptMetadataFormatter.cs
- ToolStripItemCollection.cs
- XamlStream.cs
- HMACSHA256.cs
- IndexedEnumerable.cs
- RepeatButton.cs
- MetafileHeaderEmf.cs
- ProvideValueServiceProvider.cs
- SqlUdtInfo.cs
- HtmlValidationSummaryAdapter.cs
- CatchDesigner.xaml.cs
- QilVisitor.cs
- LowerCaseStringConverter.cs
- KerberosRequestorSecurityTokenAuthenticator.cs
- RemotingServices.cs