title: 401: unauthorized issue in Web API .net core C#
body: <pre><code>    I am getting JWT Token from the React UI using AcquireTokenSilent of MSAL. Now, I have to call Graph API using this token in Web API(.net core) in C#.
      Before calling the Graph API I am getting &quot;401 :Unauthorized&quot;. Please help me in resolving the issue.       
      
      In Startup.cs I am using following code:
      ----------
      public void ConfigureServices(IServiceCollection services)
                  {
                      services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
                          .AddMicrosoftIdentityWebApi(Configuration,&quot;AzureAd&quot;)
                              .EnableTokenAcquisitionToCallDownstreamApi()
                                  .AddMicrosoftGraph(Configuration.GetSection(&quot;DownstreamApi&quot;))
                                  .AddInMemoryTokenCaches();
                  }
          
          
            public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
                 {
                     app.UseAuthentication();
                     app.UseRouting();
                     app.UseAuthorization();
                 }
          
         
           In ProfileController.cs
          
           [HttpPost]
                  public async Task&lt;ActionResult&gt; PostProfileItem([FromBody]SetProfile setprofile)
                  {
                       
                      HttpContext.VerifyUserHasAnyAcceptedScope(scopeRequiredByApi);
                       
                      try
                      {
                          List&lt;HeaderOption&gt; requestHeaders = new List&lt;HeaderOption&gt;() { new HeaderOption(&quot;Authorization&quot;, &quot;Bearer &quot; + setprofile.access_token) };
                          User profile = await _graphServiceClient.Me.Request(requestHeaders).GetAsync();
                  }
                 (catch Exception ex)
                  {
                  }
                return Ok(profile);
              }
          
              SetProfile.cs
          namespace Web.Dto
          {
              public record SetProfile
              {
                 [NotMapped]
                 [JsonProperty(&quot;access_token&quot;)]
                 [Required]
                  public string access_token { get; init; }
                 
              }
          
              
          }
      
     
      
      
  </code></pre>
  <h2>React UI code acquiring the token and posting the access token to the ProfileController.cs</h2>
  <h2>if (!graphData &amp;&amp; inProgress === InteractionStatus.None) { //instance of Form Data let formData = new FormData() // Acquire token silent instance.acquireTokenSilent(accessTokenRequest) //then clause .then((accessTokenResponse) =&gt; { // Acquire token silent success let accessToken = accessTokenResponse.accessToken; //logging access token console.log(<code>access token : ${accessToken}</code>) //code to add access token in API formData.append(&quot;access_token&quot;, accessToken) //call to profile API props.userProfileCall(formData) }); //code to catch error }).catch((error) =&gt; { //logging error console.log(error); })</h2>