# .NET Core Web API & Auth0 IDX20803 error

**URL:** <https://community.auth0.com/t/net-core-web-api-auth0-idx20803-error/62643>\
**Category:** Get Help\
**Tags:** api, net-core\
**Created:** [May 12, 2021, 6:59am UTC](https://community.auth0.com/t/net-core-web-api-auth0-idx20803-error/62643 "2021-05-12T06:59:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![adeliab](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/adeliab/32/12951_2.png) [@adeliab](https://community.auth0.com/u/adeliab)\
**Post date:** [May 12, 2021, 6:59am UTC](https://community.auth0.com/t/net-core-web-api-auth0-idx20803-error/62643/1 "2021-05-12T06:59:46Z")

</div>

Hi,

I’m trying out this tutorial: [Authorization for ASP.NET Web APIs](https://auth0.com/blog/how-to-build-and-secure-web-apis-with-aspnet-core-3/#Creating-an-ASP-NET-Core-Web-API-Project)

When I test the API with the Bearer token, I got this error instead:

System.InvalidOperationException: IDX20803: Unable to obtain configuration from: ‘[PII is hidden. For more details, see [Bing](https://aka.ms/IdentityModel/PII.)]’.  
—\> System.IO.IOException: IDX20807: Unable to retrieve document from: ‘[PII is hidden. For more details, see [Bing](https://aka.ms/IdentityModel/PII.)]’. HttpResponseMessage: ‘[PII is hidden. For more details, see [Bing](https://aka.ms/IdentityModel/PII.)]’, HttpResponseMessage.Content: ‘[PII is hidden. For more details, see [Bing](https://aka.ms/IdentityModel/PII.)]’.  
at Microsoft.IdentityModel.Protocols.HttpDocumentRetriever.GetDocumentAsync(String address, CancellationToken cancel)  
at Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfigurationRetriever.GetAsync(String address, IDocumentRetriever retriever, CancellationToken cancel)  
at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel) --- End of inner exception stack trace --- at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel)  
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()  
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()  
at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync()  
at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)  
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)  
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Can you help solve this? Thanks

---

<div class="post-metadata">

**Author:** ![curtis.egiftit.admin](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/curtis.egiftit.admin/32/29089_2.png) [@curtis.egiftit.admin](https://community.auth0.com/u/curtis.egiftit.admin)\
**Post date:** [May 12, 2021, 7:59am UTC](https://community.auth0.com/t/net-core-web-api-auth0-idx20803-error/62643/2 "2021-05-12T07:59:50Z")

</div>

Hi @adeliab

Check within your **appsettings.Development.json** file and ensure that the audience value is using **https** (a secure call) and not **http** (a unsecure call).

Also, please indicate the version of the Microsoft.AspNetCore.Authentication.JwtBearer nuget package that you are using in your project.

---

<div class="post-metadata">

**Author:** ![adeliab](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/adeliab/32/12951_2.png) [@adeliab](https://community.auth0.com/u/adeliab)\
**Post date:** [May 12, 2021, 8:04am UTC](https://community.auth0.com/t/net-core-web-api-auth0-idx20803-error/62643/3 "2021-05-12T08:04:49Z")

</div>

hi @curtis.egiftit.admin ,

It’s working now. I’m using postman and when I set the token in the Headers tab, it throws that error. But when I set it in the Authorization tab, then it works.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [May 12, 2021, 11:49am UTC](https://community.auth0.com/t/net-core-web-api-auth0-idx20803-error/62643/4 "2021-05-12T11:49:38Z")

</div>

Thanks for sharing that with the rest of community!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [May 27, 2021, 11:49am UTC](https://community.auth0.com/t/net-core-web-api-auth0-idx20803-error/62643/5 "2021-05-27T11:49:48Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
