Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JWT Token cannot be validated into an ASP.NET Core Web API. #913

Closed
congiuluc opened this issue Oct 14, 2024 · 1 comment
Closed

JWT Token cannot be validated into an ASP.NET Core Web API. #913

congiuluc opened this issue Oct 14, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request work in progress

Comments

@congiuluc
Copy link
Contributor

Description

The JWT Toke created to test an ASP.NET Core Web API cannot be validated by ASP.NET Core, always get error 401

Expected behaviour

The generated token should be verified by ASP.NET Core so that is possible to test an API endpoint that requires authentication and authorization

Actual behaviour

The token is signed using a random signing key

Steps to reproduce

Generate a JWT Token, create an ASP.NET Web Minimal API and add authentication using JWT Bearer

Dev Proxy Version

0.21.0

Operating system (environment)

Windows

Shell

PowerShell

Configuration file

Command line tool: devproxy.exe jwt create -k --name "Luca Congiu" --issuer "my-app" --audience "https://myserver.com" --roles "admin" --scopes "read" --scopes "write" --claims "custom:claim" --valid-for 120

Additional Info

No response

@congiuluc congiuluc added the bug Something isn't working label Oct 14, 2024
@waldekmastykarz waldekmastykarz added enhancement New feature or request work in progress and removed bug Something isn't working labels Oct 16, 2024
@waldekmastykarz waldekmastykarz changed the title [BUG]: JWT Token cannot be validated into an ASP.NET Core Web API. JWT Token cannot be validated into an ASP.NET Core Web API. Oct 16, 2024
@waldekmastykarz
Copy link
Collaborator

Thanks for reaching out @congiuluc. That was by design, but I agree that it's a shortcoming. We've been thinking about exposing the random string, but your suggestion in #914 to let users specify the signing key is also a very nice idea. Let's go with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request work in progress
Projects
None yet
Development

No branches or pull requests

2 participants