开发者

Sharing authentication between new pages built in MVC and existing WebForms ASP.NET project

开发者 https://www.devze.com 2023-03-15 21:30 出处:网络
I\'m working on a project that is built using Web Forms framework.We are trying to move to MVC by building all the new pages using MVC.Both type开发者_如何学运维s of pages are in same project.I\'m cur

I'm working on a project that is built using Web Forms framework. We are trying to move to MVC by building all the new pages using MVC. Both type开发者_如何学运维s of pages are in same project. I'm curious to know how people went about sharing authentication between Web Forms and MVC.


As noted, if you are able to use forms authentication, then you are able to deal with it in the same manner as you normally would - using one or the other. If the code is on the same box, then the same machine key will be used for the ticket, so it will be available whether you are accessing the status via MVC or WF. If you are on a farm, you will be, again, dealing with the same issues as you would if using just one. The web.config etc. shall all be the same and you can even share the same login redirect.


Both Web Forms and MVC can work with the built-in Forms Authentication so you can depend on it.

I think you can build a top layer which takes over authentication and each page will deal with this layer in its special way depending on whether it was Web Forms or MVC.

0

精彩评论

暂无评论...
验证码 换一张
取 消