dotnet / dotnet/aspnetcore

Make it easier to leverage existing configured JWT and JWKS infra to manually validate tokens

Open
#58,851 2 comments 0 reactions 0 assignees View on GitHub
area-auth enhancement
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

I have a situation where I want to do a one-off validation of an incoming webhook. In [the one implementation that I'm dealing with](https://fusionauth.io/docs/extend/events-and-webhooks/signing), the webhook comes with a JWT in a custom header.

The JWT itself can be validated from the same authority as the rest of my application, but based on how they implemented it, it doesn't represent anything useful to the ASP.NET auth subsystems.

### Describe the solution you'd like

That all said, I'd still like to be able to leverage the JWKS and JWT already set up in my app. It would be nice if I could `[FromServices]` some kind of `JwtOneOffValidator` and simply ask it "hey, is this string/bytes good?"

### Additional context

I could fuss about with re-wiring a parallel graph for JWT validation, but then I wouldn't be benefiting from what's already in my DI. Seems like needless duplication, I don't benefit from JWKS caching and I'm now a little more coupled to the framework (not bad, just not great!).

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.