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
- AccessedThroughPropertyAttribute.cs
- ObjectListFieldCollection.cs
- LocalizationComments.cs
- XmlValidatingReader.cs
- OracleDataReader.cs
- IndentedWriter.cs
- XPathException.cs
- PolicyUnit.cs
- IntAverageAggregationOperator.cs
- SqlResolver.cs
- SymbolMethod.cs
- AffineTransform3D.cs
- ObjectHandle.cs
- InstanceNameConverter.cs
- CrossAppDomainChannel.cs
- _ShellExpression.cs
- ClickablePoint.cs
- SignedInfo.cs
- QuaternionIndependentAnimationStorage.cs
- HttpRequestCacheValidator.cs
- pingexception.cs
- ConcurrentBag.cs
- IgnoreSection.cs
- IsolatedStorageFileStream.cs
- NamespaceMapping.cs
- Panel.cs
- DBConcurrencyException.cs
- WindowsStartMenu.cs
- AsyncPostBackTrigger.cs
- Vector3DKeyFrameCollection.cs
- SchemaExporter.cs
- SrgsOneOf.cs
- XmlWhitespace.cs
- WinCategoryAttribute.cs
- ObjectViewListener.cs
- OleDbRowUpdatingEvent.cs
- Int64Converter.cs
- DSASignatureFormatter.cs
- Processor.cs
- ProcessHostConfigUtils.cs
- ProcessMonitor.cs
- DataExpression.cs
- SequenceNumber.cs
- HierarchicalDataBoundControl.cs
- BindingMAnagerBase.cs
- MailAddressCollection.cs
- TypeReference.cs
- SafeBitVector32.cs
- XsdDateTime.cs
- SqlTransaction.cs
- Selection.cs
- CompilerInfo.cs
- QilTernary.cs
- Underline.cs
- WebPartCatalogCloseVerb.cs
- EntityTransaction.cs
- AsyncCallback.cs
- COM2ExtendedBrowsingHandler.cs
- RegexParser.cs
- OptimalTextSource.cs
- Aggregates.cs
- SqlVersion.cs
- HtmlImage.cs
- XmlSchemaAnyAttribute.cs
- AssemblyCache.cs
- OverflowException.cs
- WindowsIPAddress.cs
- WindowInteractionStateTracker.cs
- HttpListenerContext.cs
- EasingFunctionBase.cs
- DataGridViewRowCancelEventArgs.cs
- SharedStatics.cs
- HiddenField.cs
- Visitor.cs
- DataTableMappingCollection.cs
- DbMetaDataColumnNames.cs
- MarkupObject.cs
- ValidationErrorEventArgs.cs
- Processor.cs
- TemplateNameScope.cs
- DataPointer.cs
- ToolStripMenuItem.cs
- SettingsProperty.cs
- PresentationSource.cs
- OutputCacheSection.cs
- PropertiesTab.cs
- SelectionHighlightInfo.cs
- TemplateEditingVerb.cs
- SerializationException.cs
- ShellProvider.cs
- TextSelection.cs
- Graph.cs
- OdbcRowUpdatingEvent.cs
- WindowProviderWrapper.cs
- LayoutDump.cs
- DataGridViewColumn.cs
- RectangleF.cs
- ArrayExtension.cs
- ChannelSinkStacks.cs
- HttpCookiesSection.cs