System.Net.AuthenticationManager.PreAuthenticate C# (CSharp) Method

PreAuthenticate() public static method

public static PreAuthenticate ( System request, ICredentials credentials ) : Authorization
request System
credentials ICredentials
return Authorization
        public static Authorization PreAuthenticate(System.Net.WebRequest request, ICredentials credentials) { throw null; }
        public static void Register(IAuthenticationModule authenticationModule) { }

Usage Example

 internal void PreAuthIfNeeded(HttpWebRequest httpWebRequest, ICredentials authInfo)
 {
     if (!this.TriedPreAuth)
     {
         this.TriedPreAuth = true;
         if (authInfo != null)
         {
             this.PrepareState(httpWebRequest);
             System.Net.Authorization authorization = null;
             try
             {
                 authorization = AuthenticationManager.PreAuthenticate(httpWebRequest, authInfo);
                 if ((authorization != null) && (authorization.Message != null))
                 {
                     this.UniqueGroupId = authorization.ConnectionGroupId;
                     httpWebRequest.Headers.Set(this.AuthorizationHeader, authorization.Message);
                 }
             }
             catch (Exception)
             {
                 this.ClearSession(httpWebRequest);
             }
         }
     }
 }
All Usage Examples Of System.Net.AuthenticationManager::PreAuthenticate