Is supporting active directory in a web application difficult when currently build with forms auth?

ε祈祈猫儿з 提交于 2019-12-13 03:39:03

问题


I have a web application that currently only supports asp.net forms authentication.

My user business logic currently is like:

Users.GetUserByID(userID); Users.LoginUser(username, password);

i.e. it is pretty modular and I hope supporting active directory won't be difficult.

Is it possible for me to support both AD and forms? If yes, what do I do, simply insert a new user for someone who signs into using AD for the first time?


回答1:


No the only thing you have to do is witch you membership provider with the Active Directory membership provider. However there are some major differences, the user will always come in logged in with a specific user name, so there will be no need for a username and password.




回答2:


The default provider for AD is "windows integrate authentication" and this cannot mix-and-match with forms auth. However if you decide to implement a custom provider, then you can maintain your business logic. You will have to write AD integration code. And yes, using the API for AD you can automatically add users, if you wish.



来源:https://stackoverflow.com/questions/791466/is-supporting-active-directory-in-a-web-application-difficult-when-currently-bui

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!