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
- WebPartCatalogCloseVerb.cs
- DataKey.cs
- CompiledRegexRunnerFactory.cs
- AffineTransform3D.cs
- Dictionary.cs
- XmlDomTextWriter.cs
- ManipulationStartingEventArgs.cs
- controlskin.cs
- ExpressionBinding.cs
- SmtpClient.cs
- UTF7Encoding.cs
- BasePattern.cs
- UriParserTemplates.cs
- Stackframe.cs
- ToolStripPanelRow.cs
- PeerInvitationResponse.cs
- NativeWindow.cs
- GlyphingCache.cs
- URLMembershipCondition.cs
- CollectionBase.cs
- EventProviderWriter.cs
- StrokeFIndices.cs
- GlyphRun.cs
- FormsAuthenticationUserCollection.cs
- SerializationHelper.cs
- CompilerCollection.cs
- FontSourceCollection.cs
- AspNetSynchronizationContext.cs
- OutOfMemoryException.cs
- _Rfc2616CacheValidators.cs
- VisualBrush.cs
- LinkClickEvent.cs
- HostedElements.cs
- NavigationService.cs
- SendReply.cs
- _TLSstream.cs
- UIElementAutomationPeer.cs
- EventLogger.cs
- StreamGeometry.cs
- MemoryStream.cs
- Util.cs
- ChannelBinding.cs
- EntityReference.cs
- Vector3DAnimationBase.cs
- SHA1Managed.cs
- SafeFreeMibTable.cs
- GridViewPageEventArgs.cs
- HtmlWindowCollection.cs
- WorkflowRuntimeElement.cs
- HostedTransportConfigurationManager.cs
- CachedTypeface.cs
- CultureSpecificStringDictionary.cs
- DataSourceProvider.cs
- GenericIdentity.cs
- WindowsListViewItemCheckBox.cs
- EntityDataSourceContextCreatedEventArgs.cs
- WaitHandleCannotBeOpenedException.cs
- TabPage.cs
- OdbcEnvironmentHandle.cs
- sortedlist.cs
- SiteMapSection.cs
- IntPtr.cs
- ObjectComplexPropertyMapping.cs
- DBDataPermissionAttribute.cs
- complextypematerializer.cs
- DesignerFrame.cs
- XPathScanner.cs
- XmlHelper.cs
- StoreContentChangedEventArgs.cs
- FormClosingEvent.cs
- DrawingContextWalker.cs
- XDRSchema.cs
- DrawingImage.cs
- DataServiceContext.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- GPPOINTF.cs
- HttpProfileGroupBase.cs
- XmlQueryRuntime.cs
- LogRecordSequence.cs
- HitTestResult.cs
- StreamGeometry.cs
- BufferAllocator.cs
- Application.cs
- StateInitializationDesigner.cs
- ColorPalette.cs
- TextEvent.cs
- PanelContainerDesigner.cs
- TableLayoutStyleCollection.cs
- RadioButtonAutomationPeer.cs
- Rectangle.cs
- TransactionScopeDesigner.cs
- NodeFunctions.cs
- StrongNameUtility.cs
- Animatable.cs
- AssemblyBuilder.cs
- ContextMenuStripGroup.cs
- DataContractSerializerMessageContractImporter.cs
- SystemResourceKey.cs
- _CacheStreams.cs
- SafeRightsManagementPubHandle.cs