Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Security / Tokens / SspiSecurityToken.cs / 1 / SspiSecurityToken.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Security.Tokens { using System.IdentityModel.Claims; using System.ServiceModel; using System.IdentityModel.Policy; using System.IdentityModel.Tokens; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Security.Principal; using System.Net; public class SspiSecurityToken : SecurityToken { string id; TokenImpersonationLevel impersonationLevel; bool allowNtlm; NetworkCredential networkCredential; bool extractGroupsForWindowsAccounts; bool allowUnauthenticatedCallers = SspiSecurityTokenProvider.DefaultAllowUnauthenticatedCallers; DateTime effectiveTime; DateTime expirationTime; public SspiSecurityToken(TokenImpersonationLevel impersonationLevel, bool allowNtlm, NetworkCredential networkCredential) { this.impersonationLevel = impersonationLevel; this.allowNtlm = allowNtlm; this.networkCredential = SecurityUtils.GetNetworkCredentialsCopy(networkCredential); this.effectiveTime = DateTime.UtcNow; this.expirationTime = this.effectiveTime.AddHours(10); } public SspiSecurityToken(NetworkCredential networkCredential, bool extractGroupsForWindowsAccounts, bool allowUnauthenticatedCallers) { this.networkCredential = SecurityUtils.GetNetworkCredentialsCopy(networkCredential); this.extractGroupsForWindowsAccounts = extractGroupsForWindowsAccounts; this.allowUnauthenticatedCallers = allowUnauthenticatedCallers; this.effectiveTime = DateTime.UtcNow; this.expirationTime = this.effectiveTime.AddHours(10); } public override string Id { get { if (this.id == null) this.id = SecurityUniqueId.Create().Value; return this.id; } } public override DateTime ValidFrom { get { return this.effectiveTime; } } public override DateTime ValidTo { get { return this.expirationTime; } } public bool AllowUnauthenticatedCallers { get { return this.allowUnauthenticatedCallers; } } public TokenImpersonationLevel ImpersonationLevel { get { return this.impersonationLevel; } } public bool AllowNtlm { get { return this.allowNtlm; } } public NetworkCredential NetworkCredential { get { return this.networkCredential; } } public bool ExtractGroupsForWindowsAccounts { get { return this.extractGroupsForWindowsAccounts; } } public override ReadOnlyCollectionSecurityKeys { get { return EmptyReadOnlyCollection .Instance; } } } } // 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
- Adorner.cs
- DynamicDocumentPaginator.cs
- CurrencyWrapper.cs
- DataList.cs
- TraceListener.cs
- EditingCoordinator.cs
- AlternateView.cs
- LayoutSettings.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- OdbcError.cs
- BamlTreeUpdater.cs
- TemplateColumn.cs
- AttachmentCollection.cs
- TableLayoutSettings.cs
- AsymmetricSignatureFormatter.cs
- LowerCaseStringConverter.cs
- CodeArgumentReferenceExpression.cs
- XmlSiteMapProvider.cs
- CustomLineCap.cs
- ConfigurationSettings.cs
- ServiceDescriptionSerializer.cs
- XmlSignatureManifest.cs
- SqlDesignerDataSourceView.cs
- EmissiveMaterial.cs
- PersonalizableTypeEntry.cs
- Int32AnimationUsingKeyFrames.cs
- ColumnClickEvent.cs
- Module.cs
- CallbackHandler.cs
- ExpressionLink.cs
- CoreSwitches.cs
- TTSEngineProxy.cs
- OutOfProcStateClientManager.cs
- ISO2022Encoding.cs
- Pair.cs
- LabelLiteral.cs
- DataGridViewControlCollection.cs
- ColorAnimation.cs
- SubtreeProcessor.cs
- PageCatalogPart.cs
- InputScope.cs
- BinaryFormatterSinks.cs
- ComboBoxItem.cs
- ClassHandlersStore.cs
- ExpressionBinding.cs
- CopyAttributesAction.cs
- TypeReference.cs
- RepeatInfo.cs
- ClientConfigPaths.cs
- VisualTreeUtils.cs
- Type.cs
- TdsRecordBufferSetter.cs
- OpenFileDialog.cs
- SchemaImporterExtensionElement.cs
- StaticTextPointer.cs
- KeyValuePair.cs
- RequestTimeoutManager.cs
- LinqDataSource.cs
- CompoundFileIOPermission.cs
- DoubleKeyFrameCollection.cs
- AttributeProviderAttribute.cs
- EntityParameter.cs
- DataGridHeaderBorder.cs
- AddInDeploymentState.cs
- MatrixCamera.cs
- SourceFileBuildProvider.cs
- DrawingGroupDrawingContext.cs
- ApplySecurityAndSendAsyncResult.cs
- PropertyEmitterBase.cs
- TextLine.cs
- BoolExpr.cs
- LogicalCallContext.cs
- ItemList.cs
- M3DUtil.cs
- StringFunctions.cs
- CompositeActivityMarkupSerializer.cs
- ObjectDataProvider.cs
- QilInvokeLateBound.cs
- SecuritySessionSecurityTokenAuthenticator.cs
- ValueUnavailableException.cs
- DecoratedNameAttribute.cs
- UInt64Converter.cs
- HttpCookieCollection.cs
- ScrollEvent.cs
- TextBreakpoint.cs
- ListSourceHelper.cs
- HttpHandlerActionCollection.cs
- UnmanagedMemoryAccessor.cs
- PathFigureCollectionValueSerializer.cs
- ISO2022Encoding.cs
- NativeMethods.cs
- HyperLinkField.cs
- SchemaHelper.cs
- HttpRawResponse.cs
- IgnorePropertiesAttribute.cs
- SqlDelegatedTransaction.cs
- IntegrationExceptionEventArgs.cs
- OleAutBinder.cs
- ToolStripHighContrastRenderer.cs
- ControlPersister.cs