title: Need a sample implementation for AddRemoteScheme in ASP.NET
body: <p>I have a back-end application (say API-A) which authenticates incoming requests using my custom-implemented IAM solution (say IAM-I). In essence, I pass a couple of tokens from the request headers to IAM-I which processes them and decides whether the request is authenticated or not.</p>
  
  <p>I am trying to create a remote authentication scheme to invoke IAM-I from API-A. How do I create my own instance of <code>AuthenticationBuilder.AddRemoteScheme</code> and <code>Microsoft.AspNetCore.Authentication.RemoteAuthenticationOptions</code> to implement this?</p>
  
  <p>I have written this:</p>
  
  <pre><code>iServiceCollection
       .AddAuthentication(fun options -&gt;
            options.DefaultScheme          &lt;- JwtBearerDefaults.AuthenticationScheme
            options.DefaultChallengeScheme &lt;- JwtBearerDefaults.AuthenticationScheme)
       .AddRemoteScheme("IAM-I Scheme", "IAM-I", remoteAuthAction)
  
  let remoteAuthAction: Action&lt;RemoteAuthenticationOptions&gt; = new Action&lt;RemoteAuthenticationOptions&gt;(fun options -&gt;
       ................ **TO BE FILLED** .................
  );
  </code></pre>
  
  <p>Can someone help me figure out how to implement <a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.authentication.remoteauthenticationoptions?view=aspnetcore-2.2" rel="noreferrer">RemoteAuthenticationOptions</a>? I couldn't find any example online.</p>
  
  <p>The above snippet is in F# but I am okay with either F# or C#.</p>