Skip to content

Update AuthenticateRequest to support Minimal APIs #25

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

adamreed90
Copy link

feat(auth): Add ASP.NET Core HttpRequest overload for AuthenticateRequest

Add method overload to Clerk's AuthenticateRequest class to directly support ASP.NET Core HttpRequest objects without conversion. This improves compatibility with Minimal APIs and Native AOT compilation by:

  • Eliminating complex request conversion between HttpRequest and HttpRequestMessage
  • Reducing object allocations for better performance
  • Maintaining the same security validation logic as the original method
  • Supporting direct extraction of auth tokens from HttpRequest objects

This change allows for cleaner integration with ASP.NET Core Minimal APIs while preserving the existing functionality for HttpRequestMessage scenarios.

feat(auth): Add ASP.NET Core HttpRequest overload for AuthenticateRequest

Add method overload to Clerk's AuthenticateRequest class to directly
support ASP.NET Core HttpRequest objects without conversion. This
improves compatibility with Minimal APIs and Native AOT compilation by:

- Eliminating complex request conversion between HttpRequest and HttpRequestMessage
- Reducing object allocations for better performance
- Maintaining the same security validation logic as the original method
- Supporting direct extraction of auth tokens from HttpRequest objects

This change allows for cleaner integration with ASP.NET Core Minimal APIs
while preserving the existing functionality for HttpRequestMessage scenarios.
@adamreed90 adamreed90 changed the title Update AuthenticateRequest.cs Update AuthenticateRequest to support Minimal APIs Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant