-
Notifications
You must be signed in to change notification settings - Fork 17
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
How to secure Elmah.axd in Web Api project #18
Comments
The Elmah documentation already has everything you need to secure the Elmah.axd page using the web.config: https://code.google.com/p/elmah/wiki/SecuringErrorLogPages If you are using a pure Web API project then you should also ignore .axd routes. Put this in your startup configuration before you configure Web API or use OWIN
|
The solution @brutaldev mentioned is not working on WebAPI 2.2. do you know if there is a workaround for this? Note: I'm using my own subdomain restapi.domain.com so my WebApiConfig.cs looks like this:
|
@vhugogarcia The sugggestion does work with Web API 2.2 (5.2.3), you fist need to ignore In your case you need to ignore Use The issue on how to secure the page though, which can do normally through |
right, to secure the resource .axd I made it via web.config on:
But, I cannot access it from my local instance the /elmah.axd it keeps returning:
Find below the full code of my WebApiConfig file:
and the Global.asax
|
Wrong place. You need to ignore routes before you setup anything else regarding routes, the order of execution is important. You are calling Again, this is not the right place to get implementation help like this (StackOverflow probably is), the issue is regarding the securing of the Elmah page, not how to get it to display in the first place. |
Another thing, |
Thanks @brutaldev I created a topic into Stackoverflow to follow there the implementation as you suggested. http://stackoverflow.com/questions/30987439/elmah-axd-on-webapi-2-2-no-http-resource-was-found Would you mind take a look there please? thanks in advance. btw, I moved up what you suggested and did not work neither. Also setup to true allowing access temporary to ensure it works just fine, but no luck neither. |
Hi,
The package works great with Web API and it successfully able to log all unhandled exception to Elmah. however little worry about securing Elmah.axd though. I am using Asp.Net Identity Token Bearer authentication for making API calls, so the default security mechanism not be valid in my case. Any idea how could I secure in my case, I want to allow this only to a user who has admin role. Please suggest
The text was updated successfully, but these errors were encountered: