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
- RelationshipDetailsRow.cs
- XamlLoadErrorInfo.cs
- SqlReferenceCollection.cs
- CustomAttribute.cs
- DataControlCommands.cs
- XmlAttribute.cs
- CompilerHelpers.cs
- SourceElementsCollection.cs
- Mouse.cs
- FontStretches.cs
- GenerateTemporaryTargetAssembly.cs
- ChangesetResponse.cs
- InstalledFontCollection.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- X509ChainPolicy.cs
- CompilationUtil.cs
- DetailsViewDeleteEventArgs.cs
- SecurityPolicySection.cs
- Input.cs
- LambdaCompiler.Expressions.cs
- RequiredAttributeAttribute.cs
- HttpListenerException.cs
- FamilyTypefaceCollection.cs
- DataGridRelationshipRow.cs
- XmlFormatExtensionPointAttribute.cs
- DebugView.cs
- ProfileInfo.cs
- BinaryObjectReader.cs
- AssemblyAttributesGoHere.cs
- DataGridCommandEventArgs.cs
- SerializationBinder.cs
- DBParameter.cs
- FileDialog.cs
- GlyphsSerializer.cs
- PixelFormatConverter.cs
- ClientSettingsStore.cs
- BaseProcessor.cs
- Matrix3DConverter.cs
- EntityDataSourceWizardForm.cs
- ChangePassword.cs
- MorphHelper.cs
- ProfileModule.cs
- PromptStyle.cs
- EventLogTraceListener.cs
- DbConnectionPoolIdentity.cs
- PropertyPath.cs
- SqlConnectionFactory.cs
- latinshape.cs
- GenericRootAutomationPeer.cs
- SqlFacetAttribute.cs
- XPathConvert.cs
- UnaryNode.cs
- SQLDateTimeStorage.cs
- NextPreviousPagerField.cs
- BamlCollectionHolder.cs
- EventLogger.cs
- Invariant.cs
- TimeManager.cs
- RSAOAEPKeyExchangeFormatter.cs
- Deflater.cs
- UnauthorizedAccessException.cs
- clipboard.cs
- XmlSerializerSection.cs
- GlyphRun.cs
- OdbcEnvironmentHandle.cs
- DecimalSumAggregationOperator.cs
- AuthStoreRoleProvider.cs
- dbenumerator.cs
- FormatConvertedBitmap.cs
- CharStorage.cs
- TrackingWorkflowEventArgs.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- EntityClassGenerator.cs
- RuleConditionDialog.Designer.cs
- IgnoreDataMemberAttribute.cs
- Dispatcher.cs
- ConnectionManagementElementCollection.cs
- ResourceWriter.cs
- ContentPosition.cs
- CommentEmitter.cs
- Base64Encoder.cs
- FieldMetadata.cs
- StyleBamlRecordReader.cs
- AspNetHostingPermission.cs
- SoapReflectionImporter.cs
- TextCompositionManager.cs
- StatusBarPanelClickEvent.cs
- IconBitmapDecoder.cs
- TableRow.cs
- IteratorDescriptor.cs
- ValidatingCollection.cs
- HttpCookie.cs
- DataGridViewSortCompareEventArgs.cs
- ObjectResult.cs
- FilterException.cs
- WindowsListViewSubItem.cs
- XmlSchemaComplexContentRestriction.cs
- PeerReferralPolicy.cs
- DynamicValidatorEventArgs.cs
- EntitySetDataBindingList.cs