Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Net / System / Net / Mail / SmtpDigestAuthenticationModule.cs / 2 / SmtpDigestAuthenticationModule.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net.Mail { using System; using System.Collections; using System.IO; using System.Net; using System.Security.Permissions; // #if MAKE_MAILCLIENT_PUBLIC internal #else internal #endif class SmtpDigestAuthenticationModule : ISmtpAuthenticationModule { Hashtable sessions = new Hashtable(); internal SmtpDigestAuthenticationModule() { } #region ISmtpAuthenticationModule Members // Security this method will access NetworkCredential properties that demand UnmanagedCode and Environment Permission [EnvironmentPermission(SecurityAction.Assert, Unrestricted=true)] [SecurityPermission(SecurityAction.Assert, Flags=SecurityPermissionFlag.UnmanagedCode)] public Authorization Authenticate(string challenge, NetworkCredential credential, object sessionCookie) { lock (this.sessions) { NTAuthentication clientContext = this.sessions[sessionCookie] as NTAuthentication; if (clientContext == null) { if(credential == null){ return null; } // this.sessions[sessionCookie] = clientContext = new NTAuthentication(false,"WDigest",credential,null, ContextFlags.Connection); } string resp = (challenge != null ? clientContext.GetOutgoingBlob(challenge) : clientContext.GetOutgoingBlob(null)); if (!clientContext.IsCompleted) { return new Authorization(resp, false); } else { this.sessions.Remove(sessionCookie); return new Authorization(resp, true); } } } public string AuthenticationType { get { return "WDigest"; } } public void CloseContext(object sessionCookie) { // This is a no-op since the context is not // kept open by this module beyond auth completion. } #endregion } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SizeAnimationBase.cs
- WebPartConnectVerb.cs
- UInt16.cs
- PartitionedStreamMerger.cs
- SqlCharStream.cs
- VectorAnimationUsingKeyFrames.cs
- DelegateHelpers.Generated.cs
- SourceLineInfo.cs
- CalendarDay.cs
- OdbcCommandBuilder.cs
- SettingsPropertyCollection.cs
- SecurityElement.cs
- TextSelectionHelper.cs
- Registration.cs
- ObjectContextServiceProvider.cs
- DeclarativeCatalogPartDesigner.cs
- CheckedListBox.cs
- ModulesEntry.cs
- _DisconnectOverlappedAsyncResult.cs
- NextPreviousPagerField.cs
- StringComparer.cs
- VisualTreeHelper.cs
- CorrelationInitializer.cs
- FixedStringLookup.cs
- TargetInvocationException.cs
- StyleHelper.cs
- SiteMap.cs
- BamlCollectionHolder.cs
- SecurityTokenTypes.cs
- InternalTransaction.cs
- SafeFileHandle.cs
- DbXmlEnabledProviderManifest.cs
- HtmlInputFile.cs
- SelectorAutomationPeer.cs
- HierarchicalDataBoundControl.cs
- LookupBindingPropertiesAttribute.cs
- ApplicationGesture.cs
- XmlUTF8TextReader.cs
- ColorConvertedBitmapExtension.cs
- CounterSampleCalculator.cs
- PeerName.cs
- GradientStopCollection.cs
- DataGridViewRowCollection.cs
- XmlDataSourceNodeDescriptor.cs
- DefaultWorkflowLoaderService.cs
- CompiledRegexRunner.cs
- OdbcConnectionPoolProviderInfo.cs
- TableRowCollection.cs
- XmlJsonReader.cs
- SqlNodeTypeOperators.cs
- XmlExpressionDumper.cs
- SqlRowUpdatingEvent.cs
- ControlAdapter.cs
- FrugalMap.cs
- Automation.cs
- DoubleCollectionConverter.cs
- coordinatorfactory.cs
- DiscardableAttribute.cs
- LabelDesigner.cs
- BitmapEffectDrawingContent.cs
- QueryReaderSettings.cs
- EncodingNLS.cs
- NamedPermissionSet.cs
- DynamicValidatorEventArgs.cs
- EnumerableRowCollection.cs
- BoolExpr.cs
- SystemResources.cs
- X509Utils.cs
- WpfXamlLoader.cs
- Point.cs
- VisualStyleTypesAndProperties.cs
- TextEditorTables.cs
- SettingsAttributes.cs
- RtfNavigator.cs
- ToolStripMenuItem.cs
- InternalRelationshipCollection.cs
- ArglessEventHandlerProxy.cs
- ConsoleCancelEventArgs.cs
- TransportConfigurationTypeElement.cs
- DisplayNameAttribute.cs
- TranslateTransform.cs
- RichTextBoxAutomationPeer.cs
- EnumValAlphaComparer.cs
- DynamicMethod.cs
- DiscoveryClientElement.cs
- XmlValidatingReader.cs
- SynchronizedInputProviderWrapper.cs
- ParameterModifier.cs
- SignatureTargetIdManager.cs
- MatrixStack.cs
- DoubleStorage.cs
- BlurBitmapEffect.cs
- VoiceInfo.cs
- InputMethodStateTypeInfo.cs
- ScrollViewerAutomationPeer.cs
- WebPartActionVerb.cs
- PerformanceCounter.cs
- DesignerActionUI.cs
- ManagementOptions.cs
- XmlWriter.cs