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
- DictionaryEntry.cs
- IIS7WorkerRequest.cs
- URLString.cs
- MonikerSyntaxException.cs
- CompiledIdentityConstraint.cs
- HexParser.cs
- XmlQualifiedName.cs
- FeatureSupport.cs
- CanonicalFontFamilyReference.cs
- TableRowCollection.cs
- ImageButton.cs
- ValueTable.cs
- DictionarySectionHandler.cs
- CapabilitiesRule.cs
- Literal.cs
- NotifyInputEventArgs.cs
- NCryptSafeHandles.cs
- AliasedExpr.cs
- WebPartConnectionsDisconnectVerb.cs
- TriState.cs
- OleStrCAMarshaler.cs
- Baml2006KeyRecord.cs
- AppDomainProtocolHandler.cs
- DataSvcMapFileSerializer.cs
- SubstitutionResponseElement.cs
- PersonalizationAdministration.cs
- SimpleRecyclingCache.cs
- TypeSystem.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- CompositeActivityDesigner.cs
- RemotingConfigParser.cs
- _OSSOCK.cs
- XPathNode.cs
- TraceEventCache.cs
- PropertyDescriptorComparer.cs
- XmlEntityReference.cs
- TransformProviderWrapper.cs
- XpsSerializationException.cs
- CodeNamespaceCollection.cs
- RelationshipEndCollection.cs
- RootBrowserWindow.cs
- ThemeDictionaryExtension.cs
- WebPartVerb.cs
- SqlFormatter.cs
- ClientProxyGenerator.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- Form.cs
- XmlSchemaInferenceException.cs
- DeploymentSection.cs
- EditingCommands.cs
- SqlUDTStorage.cs
- DebugInfoGenerator.cs
- WebPartConnectionsCancelVerb.cs
- PackUriHelper.cs
- SlipBehavior.cs
- TcpDuplicateContext.cs
- TcpServerChannel.cs
- TextBoxBaseDesigner.cs
- WebPartConnectionsCloseVerb.cs
- SslStreamSecurityUpgradeProvider.cs
- MetadataArtifactLoaderCompositeFile.cs
- File.cs
- PropertyFilterAttribute.cs
- GridViewDesigner.cs
- Lazy.cs
- ELinqQueryState.cs
- ActivationServices.cs
- Size.cs
- FieldToken.cs
- Brushes.cs
- ReadOnlyHierarchicalDataSource.cs
- DataTableTypeConverter.cs
- ScriptResourceDefinition.cs
- ParameterCollection.cs
- CodeTypeDelegate.cs
- ServiceDescription.cs
- TextServicesHost.cs
- SchemaTypeEmitter.cs
- FilePresentation.cs
- UniqueSet.cs
- IdentityModelDictionary.cs
- SchemaNamespaceManager.cs
- LoaderAllocator.cs
- ListBoxDesigner.cs
- RegexCapture.cs
- Expander.cs
- MobileControlPersister.cs
- BoolExpressionVisitors.cs
- WindowsListViewItemStartMenu.cs
- ExpressionVisitorHelpers.cs
- NodeFunctions.cs
- ImageSource.cs
- PageCatalogPart.cs
- DCSafeHandle.cs
- SecurityDescriptor.cs
- ImageList.cs
- WebPartEditorOkVerb.cs
- SqlTriggerAttribute.cs
- DbParameterHelper.cs
- AnalyzedTree.cs