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

◆ Authenticate()

Authorization System.Net.Mail.SmtpNegotiateAuthenticationModule.Authenticate ( string challenge,
NetworkCredential credential,
object sessionCookie,
string spn,
ChannelBinding channelBindingToken )
inline

Implements System.Net.Mail.ISmtpAuthenticationModule.

Definition at line 17 of file SmtpNegotiateAuthenticationModule.cs.

18 {
19 try
20 {
22 {
24 {
25 if (credential == null)
26 {
27 return null;
28 }
29 value = (_sessions[sessionCookie] = new System.Net.NTAuthentication(isServer: false, "Negotiate", credential, spn, System.Net.ContextFlagsPal.Connection | System.Net.ContextFlagsPal.AcceptStream, channelBindingToken));
30 }
31 string token = null;
32 if (!value.IsCompleted)
33 {
34 byte[] incomingBlob = null;
35 if (challenge != null)
36 {
37 incomingBlob = Convert.FromBase64String(challenge);
38 }
39 byte[] outgoingBlob = value.GetOutgoingBlob(incomingBlob, thrownOnError: false);
40 if (value.IsCompleted && outgoingBlob == null)
41 {
42 token = "\r\n";
43 }
44 if (outgoingBlob != null)
45 {
46 token = Convert.ToBase64String(outgoingBlob);
47 }
48 }
49 else
50 {
52 }
53 return new Authorization(token, value.IsCompleted);
54 }
55 }
56 catch (NullReferenceException)
57 {
58 return null;
59 }
60 }
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
string GetSecurityLayerOutgoingBlob(string challenge, System.Net.NTAuthentication clientContext)
readonly Dictionary< object, System.Net.NTAuthentication > _sessions

References System.Net.Mail.SmtpNegotiateAuthenticationModule._sessions, System.Net.Authorization, System.Convert.FromBase64String(), System.Net.Mail.SmtpNegotiateAuthenticationModule.GetSecurityLayerOutgoingBlob(), System.Convert.ToBase64String(), System.Collections.Generic.Dictionary< TKey, TValue >.TryGetValue(), and System.value.