Get windows login name without Windows Authentication

安稳与你 提交于 2019-12-02 09:17:21

In order to get username, you need to use something besides anonymous authentication.

Using Anonymous authentication, you cannot get the username of a local user. Even if this were possible, it would not be practical with a public facing site b/c you could have multiple computers with the same local username.

Also, since you mentioned that this is an external facing site outside of a corporate domain, then Windows Authentication is not an option. Windows Authentication is mainly used for internal intranet applications.

What you likely are looking for if you want to uniquely ID each user, and have is Forms authentication, which ASP.NET supports and provides an out of the box controls for allowing users to register and create accounts for your website. Check out this link http://msdn.microsoft.com/en-us/library/7t6b43z4.aspx

To answer: "Will it be possible in ASP.NET page level authentication by setting in Web.Config?" Setting the authorization rules of <allow user="*"/> or <deny user="?"/> in web.config controls the authorization for a given user (whether or not a given user can get to a page in this case) AFTER the user has been authenticated, but does not have an impact on the authentication method or the membership provider used. So this web.config setting will not allow you to get a username using anonymous authentication.

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