[英]How to flow Net 6 Identity Authorisation to YARP Proxied Net Framework App
I'm trying to use the strangler fig pattern to migrate a legacy Net Framework MVC app in stages.我正在尝试使用 strangler fig 模式分阶段迁移旧版 Net Framework MVC 应用程序。 I heard a talk by Mark Rendle about using YARP to migrate a Webforms app this way, which was great.
我听过 Mark Rendle 关于使用 YARP 以这种方式迁移 Webforms 应用程序的演讲,非常棒。 However, I can't find any examples anywhere of using this methodology to migrate from a Net Framework MVC app to new Net 6 MVC app.
但是,我无法在任何地方找到任何使用此方法从 Net Framework MVC 应用程序迁移到新的 Net 6 MVC 应用程序的示例。
I've managed to set up the basic proxy which is working (see example repo below).我已经设法设置了正在运行的基本代理(请参阅下面的示例 repo)。 However I don't know where to begin with flowing the Identity Authentication through from the Net 6 App to the Net Framework app.
但是我不知道从哪里开始将身份验证从 Net 6 应用程序流到 Net Framework 应用程序。 I can see that the auth cookie is passed through to the proxied Net Framework app, but I don't know how to take that and say "hey use this" in the Framework app.
我可以看到 auth cookie 已传递到代理的 Net Framework 应用程序,但我不知道如何接受它并在 Framework 应用程序中说“嘿使用这个”。
Links:链接:
Any pointers on how to achieve this authentication flow would be greatly appreciated.非常感谢任何有关如何实现此身份验证流程的指示。
Microsoft must have been getting this a lot...微软一定得到了很多......
They have created a new nuget package (currently in preview):他们创建了一个新的 nuget package(目前处于预览状态):
Microsoft.AspNetCore.SystemWebAdapters Microsoft.AspNetCore.SystemWebAdapters
And have an article on its use (thanks Mike Rousos:):并有一篇关于它的使用的文章(感谢 Mike Rousos:):
https://devblogs.microsoft.com/do.net/incremental-asp.net-migration-tooling-preview-2/ https://devblogs.microsoft.com/do.net/incremental-asp.net-migration-tooling-preview-2/
I have updated my example git repo and reworked a few bits and everything seems to be working as expected.我已经更新了我的示例 git 存储库并修改了一些内容,一切似乎都按预期工作。
Happy days.快乐的时光。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.