Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Authenticate()

void System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult.Authenticate ( )
inlineprivate

Definition at line 359 of file SmtpConnection.cs.

360 {
361 if (_connection._credentials != null)
362 {
364 {
365 ISmtpAuthenticationModule smtpAuthenticationModule = _connection._authenticationModules[_currentModule];
366 if (!_connection.AuthSupported(smtpAuthenticationModule))
367 {
368 continue;
369 }
370 NetworkCredential credential = _connection._credentials.GetCredential(_host, _port, smtpAuthenticationModule.AuthenticationType);
371 if (credential == null)
372 {
373 continue;
374 }
375 Authorization authorization = _connection.SetContextAndTryAuthenticate(smtpAuthenticationModule, credential, _outerResult);
376 if (authorization == null || authorization.Message == null)
377 {
378 continue;
379 }
380 IAsyncResult asyncResult = AuthCommand.BeginSend(_connection, _connection._authenticationModules[_currentModule].AuthenticationType, authorization.Message, s_authenticateCallback, this);
381 if (!asyncResult.CompletedSynchronously)
382 {
383 return;
384 }
385 LineInfo lineInfo = AuthCommand.EndSend(asyncResult);
386 if (lineInfo.StatusCode == (SmtpStatusCode)334)
387 {
388 _authResponse = lineInfo.Line;
390 {
391 return;
392 }
393 }
394 else if (lineInfo.StatusCode == (SmtpStatusCode)235)
395 {
396 smtpAuthenticationModule.CloseContext(_connection);
397 _connection._isConnected = true;
398 break;
399 }
400 }
401 }
402 _connection._isConnected = true;
404 }
readonly ICredentialsByHost _credentials
bool AuthSupported(ISmtpAuthenticationModule module)
Authorization SetContextAndTryAuthenticate(ISmtpAuthenticationModule module, NetworkCredential credential, System.Net.ContextAwareResult context)
readonly ISmtpAuthenticationModule[] _authenticationModules
NetworkCredential? GetCredential(string host, int port, string authenticationType)

References System.Net.Mail.SmtpConnection._authenticationModules, System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult._authResponse, System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult._connection, System.Net.Mail.SmtpConnection._credentials, System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult._currentModule, System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult._host, System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult._outerResult, System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult._port, System.asyncResult, System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult.AuthenticateContinue(), System.Net.Mail.ISmtpAuthenticationModule.AuthenticationType, System.Net.Mail.SmtpConnection.AuthSupported(), System.Net.Mail.AuthCommand.BeginSend(), System.Net.Mail.ISmtpAuthenticationModule.CloseContext(), System.Net.Mail.AuthCommand.EndSend(), System.Net.ICredentialsByHost.GetCredential(), System.Net.LazyAsyncResult.InvokeCallback(), System.Net.Mail.LineInfo.Line, System.Net.Authorization.Message, System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult.s_authenticateCallback, System.Net.Mail.SmtpConnection.SetContextAndTryAuthenticate(), and System.Net.Mail.LineInfo.StatusCode.

Referenced by System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult.AuthenticateCallback(), System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult.AuthenticateContinueCallback(), System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult.SendEHello(), System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult.SendEHelloCallback(), System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult.SendHello(), and System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult.SendHelloCallback().