title: Error occuriring with call to user authenticated http trigger
body: <p>I am using Azure Functions v3</p>
  <p>I am trying to use Authentication and I have set my function to User level security for its HttpTriggers</p>
  <p>The logic below is called on the startup of my function</p>
  <pre class="lang-cs prettyprint-override"><code>protected override void SetupAuthentication(
      IServiceCollection services, IConfiguration configuration)
  {
      var tokenOptions = configuration.GetSection(&quot;JwtIssuerOptions&quot;)
                      .Get&lt;TokenConfiguration&gt;();
                  
      var tokenValidationParameters = new TokenValidationParameters
          {
              // The signing key must match!
              ValidateIssuerSigningKey = true,
              IssuerSigningKey = tokenOptions.SecurityKey,
              // Validate the JWT Issuer (iss) claim
              ValidateIssuer = true,
              ValidIssuer = tokenOptions.Issuer,
              // Validate the JWT Audience (aud) claim
              ValidateAudience = true,
              ValidAudience = tokenOptions.Audience,
              // Validate the token expiry
              ValidateLifetime = true,
              // If you want to allow a certain amount of clock drift, set that here:
              ClockSkew = TimeSpan.Zero
          };
                  
      services.Configure&lt;IdentityConfiguration&gt;(configuration.GetSection(&quot;IdentityConfiguration&quot;));
      services.AddScoped&lt;CustomJwtBearerEvents&gt;();
      
      services
          .AddAuthentication(o =&gt;
           {
                o.DefaultForbidScheme = JwtBearerDefaults.AuthenticationScheme;
                o.DefaultScheme = JwtBearerDefaults.AuthenticationScheme;
           })
          .AddJwtBearer(options =&gt;
           {
                options.TokenValidationParameters = tokenValidationParameters;
                options.EventsType = typeof(CustomJwtBearerEvents);
           });
      
      }
  </code></pre>
  <p>When I call the function externally I get the error</p>
  <pre><code>No authentication handler is registered for the scheme 'WebJobsAuthLevel'. 
  </code></pre>
  <p>The registered schemes are: Bearer. Did you forget to call AddAuthentication().AddSomeAuthHandler?.</p>
  <p>What have I missed?</p>
  <p>I need to mimic the same convention as web apps</p>
  <pre class="lang-cs prettyprint-override"><code>[FunctionName(&quot;GetPayments&quot;)]
  public async Task&lt;List&lt;PaymentDto&gt;&gt; GetPaymentsAsync(
      [HttpTrigger(AuthorizationLevel.User, &quot;post&quot;, Route = &quot;payments/get-payments&quot;)]
       HttpRequest req, 
       ILogger log)
  {
      var data = await req.ReadAsStringAsync();
              
      //THis is where I have my logic which I only want to be able to access if the user has permissions
  }
  </code></pre>
  <p>I have seen the link below</p>
  <p><a href="https://damienbod.com/2020/09/24/securing-azure-functions-using-azure-ad-jwt-bearer-token-authentication-for-user-access-tokens/comment-page-1/?unapproved=127819&amp;moderation-hash=3fdd04b596812933c4c32e8e8c8cf26a#comment-127819" rel="nofollow noreferrer">https://damienbod.com/2020/09/24/securing-azure-functions-using-azure-ad-jwt-bearer-token-authentication-for-user-access-tokens/comment-page-1/?unapproved=127819&amp;moderation-hash=3fdd04b596812933c4c32e8e8c8cf26a#comment-127819</a></p>
  <p>It initially looked to be what I need, but I cant work out how to adapt it so that it just uses the identity token validation side</p>
  <p>Any help would be appreciated</p>
  <p>Paul</p>