-
Is there anything comparable to Authentication Based on Subrequest Result described in NGINX Docs:
I've quickly looked at Authentication and Authorization documentation and Authentication & Authorization sample but they seem to rely on middleware rather than just configuration pointing to an external service. Is it possible/desirable to emulate the functionality of the |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
YARP relies completely on AspNetCore's authentication/authorization infrastructure. You can make something like this there by implementing an AuthenticationHandler, but I don't know of any exiting implementations like that. This can also be implemented with custom middleware, it might be simpler that way. |
Beta Was this translation helpful? Give feedback.
-
Thanks, I suppose the custom middleware is the likely path to integrate external systems. Having a similar configuration based method that's used in NGINX would be advantageous for those that want to develop a solution with Express or Rails instead. I do think this would be a common use case, but for those situations maybe they would use something other than YARP anyway. Asking others to upvote and comment if they feel this would be something worth integrating into YARP or not. |
Beta Was this translation helpful? Give feedback.
-
Checking back to see if there is any functionality in YARP for forward auth as described below.
The following proxies have this functionality and I wanted to know if this can be done in YARP. |
Beta Was this translation helpful? Give feedback.
-
The recommended solution is to implement AuthenticationHandler or RemoteAuthenticationHandler (for remote SSO). Take a look at YarpWebAuthn repo for an example that uses the former to provide basic WebAuthn authentication for YARP. A middleware solution using status codes and redirects would still be useful though. |
Beta Was this translation helpful? Give feedback.
YARP relies completely on AspNetCore's authentication/authorization infrastructure. You can make something like this there by implementing an AuthenticationHandler, but I don't know of any exiting implementations like that.
https://github.com/dotnet/aspnetcore/blob/main/src/Security/Authentication/Core/src/AuthenticationHandler.cs
This can also be implemented with custom middleware, it might be simpler that way.
https://microsoft.github.io/reverse-proxy/articles/middleware.html#custom-proxy-middleware