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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- QuaternionAnimation.cs
- Panel.cs
- XsltLoader.cs
- StrokeSerializer.cs
- TableLayoutSettings.cs
- XmlCodeExporter.cs
- SimpleParser.cs
- DrawingContextDrawingContextWalker.cs
- OLEDB_Enum.cs
- MimeMapping.cs
- DataGridViewComboBoxColumn.cs
- ObfuscationAttribute.cs
- UrlAuthorizationModule.cs
- ExpressionLexer.cs
- StylusEditingBehavior.cs
- ComboBox.cs
- ValidatingPropertiesEventArgs.cs
- ListViewUpdateEventArgs.cs
- CustomWebEventKey.cs
- WorkflowRuntimeServiceElementCollection.cs
- BypassElementCollection.cs
- GridView.cs
- ResourceLoader.cs
- MenuItem.cs
- SafeFindHandle.cs
- ButtonPopupAdapter.cs
- TrackingServices.cs
- CodeBlockBuilder.cs
- GridViewSelectEventArgs.cs
- DataKeyArray.cs
- OleDbRowUpdatingEvent.cs
- DiscoveryServerProtocol.cs
- XmlSchemaType.cs
- EditorZone.cs
- SqlDataReader.cs
- TextServicesProperty.cs
- SystemTcpConnection.cs
- ItemCheckEvent.cs
- ButtonPopupAdapter.cs
- Point4D.cs
- TableSectionStyle.cs
- CodeTypeMember.cs
- DBCommand.cs
- ModelItemKeyValuePair.cs
- peersecurityelement.cs
- DataGridViewCellEventArgs.cs
- MetadataItem.cs
- DataViewSetting.cs
- Label.cs
- entityreference_tresulttype.cs
- LinkUtilities.cs
- DbProviderFactories.cs
- ObjectComplexPropertyMapping.cs
- KerberosSecurityTokenProvider.cs
- XmlSchemaObjectCollection.cs
- TextBoxRenderer.cs
- FontNamesConverter.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- WebDescriptionAttribute.cs
- ByteAnimationUsingKeyFrames.cs
- GZipDecoder.cs
- UserThread.cs
- HwndKeyboardInputProvider.cs
- HttpCachePolicyWrapper.cs
- BordersPage.cs
- XmlDeclaration.cs
- DataTableNewRowEvent.cs
- WebPartConnectionsCloseVerb.cs
- CopyOnWriteList.cs
- BinaryReader.cs
- UIPermission.cs
- NegotiateStream.cs
- DataAdapter.cs
- BuildProvidersCompiler.cs
- Size3D.cs
- SafeFileMappingHandle.cs
- SessionParameter.cs
- BitmapMetadata.cs
- XmlAggregates.cs
- EntityDataSourceDesignerHelper.cs
- DataTrigger.cs
- TreeViewCancelEvent.cs
- NetMsmqSecurityElement.cs
- HTMLTagNameToTypeMapper.cs
- PreservationFileReader.cs
- XamlToRtfParser.cs
- SmtpFailedRecipientException.cs
- SafeFileMappingHandle.cs
- PeerTransportElement.cs
- MetadataPropertyAttribute.cs
- SchemaImporter.cs
- CounterSetInstanceCounterDataSet.cs
- ReflectionUtil.cs
- XmlNode.cs
- NativeMethods.cs
- ParseElement.cs
- GroupStyle.cs
- CallbackValidator.cs
- ListBox.cs
- Error.cs