You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What happened:
I am implementing a very simple querystring-based auth, similar to how Azure functions can require keys to be passed in the URL.
The code looks like this:
.RequireAuthorization(builder => builder.RequireAssertion(handlerContext => codes.Contains((handlerContext.Resource as HttpContext)?.Request.Query["auth"].ToString())));
This works fine for the health data endpoint. It refuses to return anything unless you pass it an "auth" value that appears in the list of authorized codes. I even have the UI showing the data using one of those codes. Don't get hung up on the name. It could be "code" or "key" or anything, really. So far, so good.
When I try to apply that same .RequireAuthorization to MapHealthChecksUI, I run into a problem. The UI will not display unless you pass the same kind of auth value. If you pass it a code, the UI loads, but it's blank, and the console is complaining that it can't get to any of the js or css files, so you're left with a blank page. Is there anything I can configure so that the UI will use the same code it was given in requests for those resources?
What you expected to happen:
I expected the UI to show completely.
How to reproduce it (as minimally and precisely as possible):
Apply the snippet above to the MapHealthChecksUI call.
Populate "codes" with some sample values like this:
var codes = new[] { "foo", "bar" };
Call the UI endpoint, passing one of the allowed codes.
Source code sample:
Anything else we need to know?:
Environment:
.NET Core version 6
Healthchecks version 7.0.2
Operative system: Windows
Others:
The text was updated successfully, but these errors were encountered:
What happened:
I am implementing a very simple querystring-based auth, similar to how Azure functions can require keys to be passed in the URL.
The code looks like this:
This works fine for the health data endpoint. It refuses to return anything unless you pass it an "auth" value that appears in the list of authorized codes. I even have the UI showing the data using one of those codes. Don't get hung up on the name. It could be "code" or "key" or anything, really. So far, so good.
When I try to apply that same .RequireAuthorization to MapHealthChecksUI, I run into a problem. The UI will not display unless you pass the same kind of auth value. If you pass it a code, the UI loads, but it's blank, and the console is complaining that it can't get to any of the js or css files, so you're left with a blank page. Is there anything I can configure so that the UI will use the same code it was given in requests for those resources?
What you expected to happen:
I expected the UI to show completely.
How to reproduce it (as minimally and precisely as possible):
Source code sample:
Anything else we need to know?:
Environment:
The text was updated successfully, but these errors were encountered: