I want to check a token before proxying a request. I have this:
[Route("forwarded-server/api/{targetEndpoint}")]
public Task CheckTokenAndProxy(string targetEndpoint)
{
if (Request.Headers.TryGetValue("token", out StringValues token))
{
if (Validate(token)) return this.HttpProxyAsync($"https://forwarded-server/api/{targetEndpoint}");
}
return ?;
}
As you can see the questionmark, i dont know how to solve this. I tried to do this.HttpProxyAsync("https://myserver/forwarded-server/forbidden") and implement another route `with an IActionResult and a Forbid(), but this gives an SSL Error (The Certificate is Self-signed).
Is there either a way to solve this like I did by disabling ssl check for the proxy target or am I doing this completey wrong?
Hi,
I want to check a token before proxying a request. I have this:
As you can see the questionmark, i dont know how to solve this. I tried to do
this.HttpProxyAsync("https://myserver/forwarded-server/forbidden")
and implement another route `with an IActionResult and a Forbid(), but this gives an SSL Error (The Certificate is Self-signed).Is there either a way to solve this like I did by disabling ssl check for the proxy target or am I doing this completey wrong?