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
- OpCodes.cs
- CacheEntry.cs
- BitmapEncoder.cs
- HttpClientCertificate.cs
- ObjectListTitleAttribute.cs
- SqlConnectionPoolProviderInfo.cs
- HideDisabledControlAdapter.cs
- OleDbException.cs
- versioninfo.cs
- QilXmlReader.cs
- ScrollBarAutomationPeer.cs
- XmlHierarchyData.cs
- FullTextBreakpoint.cs
- XmlRootAttribute.cs
- EnvelopedPkcs7.cs
- EventSourceCreationData.cs
- HtmlDocument.cs
- ObjectListCommand.cs
- DocumentViewerBase.cs
- LogEntry.cs
- QueryInterceptorAttribute.cs
- METAHEADER.cs
- SymLanguageType.cs
- MruCache.cs
- NestedContainer.cs
- PrintPreviewGraphics.cs
- QilPatternFactory.cs
- LifetimeServices.cs
- LoginView.cs
- EdmTypeAttribute.cs
- VisualStyleTypesAndProperties.cs
- VirtualPathUtility.cs
- SubtreeProcessor.cs
- XmlSchemaComplexContentRestriction.cs
- WmlValidationSummaryAdapter.cs
- ChtmlPageAdapter.cs
- SqlNode.cs
- XamlContextStack.cs
- TransformerConfigurationWizardBase.cs
- IIS7WorkerRequest.cs
- InputLangChangeEvent.cs
- PhoneCall.cs
- basemetadatamappingvisitor.cs
- RightsManagementLicense.cs
- OleDbDataAdapter.cs
- PageThemeBuildProvider.cs
- PermissionSetEnumerator.cs
- SkewTransform.cs
- ListBindingHelper.cs
- LayoutInformation.cs
- TargetControlTypeAttribute.cs
- InputScopeConverter.cs
- PasswordBoxAutomationPeer.cs
- XmlSchemaSubstitutionGroup.cs
- GridViewRow.cs
- PageAdapter.cs
- SecurityCriticalDataForSet.cs
- OdbcConnectionHandle.cs
- SqlBooleanizer.cs
- MediaPlayer.cs
- MonthCalendar.cs
- MetabaseReader.cs
- GZipDecoder.cs
- ClockGroup.cs
- TableLayoutSettingsTypeConverter.cs
- Point4DValueSerializer.cs
- QueryOutputWriter.cs
- CacheEntry.cs
- PostBackOptions.cs
- MatrixKeyFrameCollection.cs
- Separator.cs
- _AutoWebProxyScriptEngine.cs
- UIHelper.cs
- WindowsListViewSubItem.cs
- SHA512Managed.cs
- BrowserTree.cs
- WindowsIdentity.cs
- KnownTypes.cs
- ColumnMap.cs
- XmlSerializerAssemblyAttribute.cs
- PolyQuadraticBezierSegment.cs
- WmfPlaceableFileHeader.cs
- LocalizableResourceBuilder.cs
- ObjectDataSourceDesigner.cs
- MemberDescriptor.cs
- ObjectKeyFrameCollection.cs
- HtmlElementEventArgs.cs
- ProfileManager.cs
- NamespaceCollection.cs
- FloaterBaseParagraph.cs
- XmlCodeExporter.cs
- WebConfigurationHostFileChange.cs
- ItemCollection.cs
- XhtmlBasicCommandAdapter.cs
- InkPresenterAutomationPeer.cs
- WebControlAdapter.cs
- TraceHandler.cs
- XmlChildEnumerator.cs
- SystemIcons.cs
- DataGridViewRowErrorTextNeededEventArgs.cs