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
- XPathDocumentBuilder.cs
- StringValidator.cs
- DbCommandDefinition.cs
- TransformFinalBlockRequest.cs
- SQLConvert.cs
- EntityContainerAssociationSet.cs
- ClientUrlResolverWrapper.cs
- SqlSelectClauseBuilder.cs
- ValidationEventArgs.cs
- RoutingExtension.cs
- SqlProfileProvider.cs
- ImageAutomationPeer.cs
- filewebrequest.cs
- OutputScope.cs
- LinqDataSourceView.cs
- TabControlDesigner.cs
- PersonalizableTypeEntry.cs
- MachineSettingsSection.cs
- TitleStyle.cs
- ContextMenuAutomationPeer.cs
- SqlInternalConnectionTds.cs
- LinqDataSourceStatusEventArgs.cs
- SqlConnectionPoolGroupProviderInfo.cs
- DesignerAttribute.cs
- AuthStoreRoleProvider.cs
- HandleRef.cs
- ClientScriptManager.cs
- DomainConstraint.cs
- entityreference_tresulttype.cs
- NamespaceDecl.cs
- ServiceNameCollection.cs
- SystemIPInterfaceStatistics.cs
- SetStoryboardSpeedRatio.cs
- ExpressionLexer.cs
- DataIdProcessor.cs
- EmulateRecognizeCompletedEventArgs.cs
- UrlPath.cs
- DataListItemCollection.cs
- IDQuery.cs
- CriticalHandle.cs
- RequestCacheValidator.cs
- Interop.cs
- Util.cs
- DataColumn.cs
- EntityDesignerUtils.cs
- Decoder.cs
- StringSorter.cs
- ProfilePropertyNameValidator.cs
- Guid.cs
- ResourceProviderFactory.cs
- Pen.cs
- HyperLinkColumn.cs
- KeyGesture.cs
- VirtualizedCellInfoCollection.cs
- FusionWrap.cs
- HtmlInputControl.cs
- HtmlFormParameterReader.cs
- QueryOperationResponseOfT.cs
- ChildrenQuery.cs
- FormViewCommandEventArgs.cs
- ManualResetEvent.cs
- Logging.cs
- ModelPropertyCollectionImpl.cs
- DataListItemCollection.cs
- ResourceSetExpression.cs
- RoutedCommand.cs
- EmptyEnumerator.cs
- XsdDataContractExporter.cs
- LinkUtilities.cs
- CollaborationHelperFunctions.cs
- SoapIncludeAttribute.cs
- ElapsedEventArgs.cs
- RenderData.cs
- WindowsAuthenticationEventArgs.cs
- OdbcFactory.cs
- AttachedPropertiesService.cs
- Literal.cs
- ScrollContentPresenter.cs
- Rijndael.cs
- OdbcUtils.cs
- Send.cs
- ProgramNode.cs
- UserPersonalizationStateInfo.cs
- ServiceContractGenerator.cs
- GridItemCollection.cs
- StyleModeStack.cs
- PublisherIdentityPermission.cs
- TextRangeAdaptor.cs
- ByteRangeDownloader.cs
- SmiMetaData.cs
- WindowsIPAddress.cs
- ProcessModuleCollection.cs
- HMACMD5.cs
- MaterialGroup.cs
- SpAudioStreamWrapper.cs
- EmptyCollection.cs
- ComPlusInstanceContextInitializer.cs
- ScriptDescriptor.cs
- InputLanguageCollection.cs
- XmlQueryContext.cs