-
Notifications
You must be signed in to change notification settings - Fork 40
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
ApiKey from route parameter and not querystring. #41
Comments
I am afraid this middleware does not support this. If you are not in control of changing the client/source from where the request is originated then may be you can try using UrlRewrite to read the apikey from URL route and append it as a query parameter if it works? https://learn.microsoft.com/en-us/aspnet/core/fundamentals/url-rewriting?view=aspnetcore-8.0 |
Thanks, I have fork the repo add ApiKeyInRouteValuesHandler. I just have to do this in the code. `protected override Task ParseApiKeyAsync()
After adding unit tests and fix compatibility issues, I can submit a PR if you want. |
Thanks for this suggestion @frederic-thibault . I have added this ability to the library with the latest 8.0.1 release. |
Thanks very much @mihirdilip , it works like a charm. |
Hi,
This is not an issue but more a question or request.
The requirement I have is to be able to register a call back url to my system to receive notification. I want to add the apikey in the url since I don't have the options to request something in a header or has a querystring parameter. It needs to be a simple url
http://1.2.3.4/{apikey}/somethingelse
[Route["{apikey}/somethingelse"]
public ...
There is a way to validate the api FromRoute parameter?
Thanks,
The text was updated successfully, but these errors were encountered: