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
- PackWebResponse.cs
- EntryWrittenEventArgs.cs
- BindingWorker.cs
- FileVersion.cs
- RenderContext.cs
- ToolStripTextBox.cs
- RegistryPermission.cs
- DataTableNameHandler.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- InvokeProviderWrapper.cs
- RepeatButtonAutomationPeer.cs
- SspiSecurityTokenParameters.cs
- XPathDocumentNavigator.cs
- ApplicationException.cs
- ConfigurationProperty.cs
- MarkerProperties.cs
- WsdlInspector.cs
- UserControl.cs
- DescendantBaseQuery.cs
- TypeProvider.cs
- WorkflowNamespace.cs
- MulticastIPAddressInformationCollection.cs
- EntityDescriptor.cs
- XmlValidatingReaderImpl.cs
- ListBox.cs
- OleDbDataReader.cs
- Mouse.cs
- CssTextWriter.cs
- SortKey.cs
- CacheHelper.cs
- WebHostedComPlusServiceHost.cs
- FastEncoderWindow.cs
- ApplicationId.cs
- StrokeFIndices.cs
- FixedSOMImage.cs
- XmlChoiceIdentifierAttribute.cs
- OrderedDictionary.cs
- EncodingStreamWrapper.cs
- GACMembershipCondition.cs
- FactoryGenerator.cs
- ConsoleEntryPoint.cs
- ImagingCache.cs
- AuthenticationModulesSection.cs
- SQLDecimalStorage.cs
- KeyValueConfigurationElement.cs
- RadioButtonRenderer.cs
- TemplateBuilder.cs
- SpellerStatusTable.cs
- Rotation3D.cs
- DataError.cs
- ContextMenuService.cs
- WebPartCancelEventArgs.cs
- IPHostEntry.cs
- BaseUriHelper.cs
- FieldBuilder.cs
- DynamicILGenerator.cs
- WebBrowserNavigatingEventHandler.cs
- serverconfig.cs
- FontFamily.cs
- BuildResultCache.cs
- CodeCompileUnit.cs
- DataGridViewRowEventArgs.cs
- CallbackException.cs
- ReverseInheritProperty.cs
- AssociationType.cs
- ConsoleTraceListener.cs
- KeyGesture.cs
- ObjectQuery.cs
- ElementHost.cs
- PolicyLevel.cs
- ContentPlaceHolderDesigner.cs
- TextUtf8RawTextWriter.cs
- EntityTypeEmitter.cs
- Style.cs
- RepeaterCommandEventArgs.cs
- RelationalExpressions.cs
- PipelineComponent.cs
- ViewGenResults.cs
- DataGridViewComboBoxColumn.cs
- processwaithandle.cs
- _NativeSSPI.cs
- SQLDateTimeStorage.cs
- HtmlLink.cs
- RegexMatchCollection.cs
- AbstractExpressions.cs
- GifBitmapEncoder.cs
- Canonicalizers.cs
- SystemResourceHost.cs
- TextCompositionEventArgs.cs
- ValidatingReaderNodeData.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- DescendentsWalkerBase.cs
- InputReport.cs
- ContentPresenter.cs
- RbTree.cs
- ProcessThread.cs
- Root.cs
- CompensateDesigner.cs
- EffectiveValueEntry.cs
- InputLangChangeRequestEvent.cs