dotnet / dotnet/aspnetcore

Cannot handle error if host is not reachable for JwtBearer

Open
#11,368 4 comments 1 reaction 0 assignees View on GitHub
area-auth
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 5h
Merged PRs (30d)
276

Description

### Describe the bug

if you have more then one authentication server (JWT or OpenID) that you trust if one of them is down we are getting error:

```
IDX20803: Unable to obtain configuration from: '[PII is hidden by default. Set the 'ShowPII' flag in IdentityModelEventSource.cs to true to reveal it.]'.
```

We should have a way to make this check optional

### To Reproduce
Steps to reproduce the behavior:
1. Add two authentication schemas with two Authority URLs
2. Turn off one of the authorities
3. See error when try to navigate to endpoint supporting both authorities

Sample configuration of two JWT bearer can be found here
https://stackoverflow.com/questions/49694383/use-multiple-jwt-bearer-authentication

### Expected behavior

Ignore authentication service if not available. Return 401 if it is the only trusted source.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.