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
- Subtree.cs
- InfoCardUIAgent.cs
- WinOEToolBoxItem.cs
- HtmlTableCell.cs
- HideDisabledControlAdapter.cs
- BitmapEffectrendercontext.cs
- KeyConverter.cs
- DefaultEvaluationContext.cs
- OperationCanceledException.cs
- EnumValAlphaComparer.cs
- SecurityCookieModeValidator.cs
- SessionIDManager.cs
- ListControl.cs
- RedirectionProxy.cs
- ToolStripSystemRenderer.cs
- Internal.cs
- WeakReferenceKey.cs
- DataGridViewButtonCell.cs
- ConstraintManager.cs
- ToolboxItemFilterAttribute.cs
- XmlSchemaAll.cs
- GeneralTransform3DCollection.cs
- ScriptManager.cs
- ParagraphResult.cs
- GlobalizationSection.cs
- OdbcUtils.cs
- XPathSelfQuery.cs
- WindowExtensionMethods.cs
- SelectedGridItemChangedEvent.cs
- PointLight.cs
- ValueSerializerAttribute.cs
- CroppedBitmap.cs
- CreateUserWizardStep.cs
- Module.cs
- Fx.cs
- DrawingBrush.cs
- TypeToken.cs
- WorkflowServiceHostFactory.cs
- Types.cs
- AdvancedBindingPropertyDescriptor.cs
- HighlightVisual.cs
- XmlReaderDelegator.cs
- securitycriticaldata.cs
- MsmqIntegrationChannelListener.cs
- CodeEventReferenceExpression.cs
- CertificateManager.cs
- Renderer.cs
- TextProviderWrapper.cs
- TextEvent.cs
- ModelVisual3D.cs
- SubtreeProcessor.cs
- SchemaExporter.cs
- RepeaterItemCollection.cs
- InternalUserCancelledException.cs
- PolyLineSegmentFigureLogic.cs
- InvalidCastException.cs
- GroupItem.cs
- TypeToken.cs
- HttpListenerContext.cs
- ResourceProperty.cs
- BamlRecordWriter.cs
- StringExpressionSet.cs
- ThicknessKeyFrameCollection.cs
- SafeCoTaskMem.cs
- Rotation3DAnimation.cs
- WebPart.cs
- ProviderManager.cs
- DataServiceRequestOfT.cs
- SatelliteContractVersionAttribute.cs
- StylusDownEventArgs.cs
- DisposableCollectionWrapper.cs
- ClientData.cs
- WindowsAuthenticationEventArgs.cs
- RelationshipFixer.cs
- DataSourceXmlElementAttribute.cs
- CompatibleComparer.cs
- RuleAttributes.cs
- MarkupExtensionParser.cs
- Button.cs
- SimpleMailWebEventProvider.cs
- SoapTransportImporter.cs
- ApplicationDirectory.cs
- hebrewshape.cs
- Mutex.cs
- MetadataArtifactLoader.cs
- SystemIPv4InterfaceProperties.cs
- TemplateBindingExtensionConverter.cs
- WebEventTraceProvider.cs
- ComponentChangedEvent.cs
- SchemaImporterExtension.cs
- ControlDesigner.cs
- DeferredBinaryDeserializerExtension.cs
- HttpInputStream.cs
- RadioButtonList.cs
- HttpModuleActionCollection.cs
- XamlToRtfWriter.cs
- DocumentSequenceHighlightLayer.cs
- Transform3D.cs
- PasswordBoxAutomationPeer.cs
- ControlPager.cs