title: How to authenticate our .NET console application against SharePoint online if we have `DisableCustomAppAuthentication` set to true
body: <p>We have the following:-</p>
  <ul>
  <li>SharePoint online tenant recently created</li>
  <li>Windows server 2019</li>
  <li>.NET console application which have some code that integrates with SharePoint online</li>
  <li>The .NET console application runs on schedule basis using windows task scheduler.</li>
  </ul>
  <p>now previously on old tenants i authenticate my code using this method by passing the ClientID and Client Secret:-</p>
  <pre><code>      static void Main(string[] args)
                {
                         
                    string siteUrl = &quot;https://***.sharepoint.com/sites/CustomerServiceKB/&quot;;
                    string clientId = &quot;******&quot;;
                    string clientSecret = &quot;*****&quot;;
                    using (ClientContext context = new OfficeDevPnP.Core.AuthenticationManager().GetAppOnlyAuthenticatedContext(siteUrl, clientId, clientSecret))
              
                    {
  </code></pre>
  <p>but on our newly created tenant we can not authenticate our code using the above method, because we have the <code>DisableCustomAppAuthentication</code> set to true.. now we do not want to modify this property.</p>
  <p>So our question is; if we have the <code>DisableCustomAppAuthentication</code> set to true (ans we do not want to set it to false), then how we can authenticate our console application? which is hosted inside our windows server and which runs on schedule basis using tasks scheduler ?</p>