Skip to content

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