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
Hello, I don't know if this is actually the process of feature request but here goes.
I think it would be beneficial if the interface IBffApiSkipAntiforgery had a Skip method that would return true by default, and would also allow us to implement it and have more fine-grained control over skipping or not skipping inside the same route.
For example, in my case, I wanted to support WebSockets in a normal proxy route, but I have to skip anti forgery in case it's a websocket request or not.. And currently for that I need add Middleware before the BffMiddleware and append manually the BffApiSkipAntiforgery attribute to the endpoint metadata, which is extremely cumbersome. Eg:
Better support for websockets with the BFF is something we have on the roadmap but is not currently planned for any specific milestones. There are a number of caveats to take into account. For one, you should ensure your endpoints are not vulnerable to csrf attacks by verifying the origin.
After that, you need to configure yarp in a specific way. Lastly, the websocket connection can live longer than the validity of the access token so you'd need to compensate for that as well.
Just fyi I think this might have more applications beyond WebSockets, it was a general improvement to the way BffMiddleware verifies the Anti Forgery header or not.
Also I wouldn't mind making the Pull Request if you guys agree but are overall are too busy.
This issue is moved from the support repo to the products repo
Original issue:
DuendeSoftware/Support#1561
Which version of Duende BFF are you using?
2.3
Which version of .NET are you using?
8.0
Hello, I don't know if this is actually the process of feature request but here goes.
I think it would be beneficial if the interface
IBffApiSkipAntiforgery
had a Skip method that would return true by default, and would also allow us to implement it and have more fine-grained control over skipping or not skipping inside the same route.For example, in my case, I wanted to support WebSockets in a normal proxy route, but I have to skip anti forgery in case it's a websocket request or not.. And currently for that I need add Middleware before the
BffMiddleware
and append manually theBffApiSkipAntiforgery
attribute to the endpoint metadata, which is extremely cumbersome. Eg:With my suggestion, it would look like this.
Using this we could create our own attributes, and use them instead, like this one
Thanks for the attention
The text was updated successfully, but these errors were encountered: