"익명 사용자 허용"옵션을 사용하여 ASP 웹 페이지에 현재 로그온 한 사용자의 Windows 로그인을 공식적으로 또는 해킹 할 수 있는지 궁금합니다. 또는 가져온 된 Windows DLL을 아마도 사용하여?asp 웹 페이지에서 Windows 로그인 사용자를 얻는 방법은 무엇입니까?
나는 "로그인 익명 사용자 거부"를 통해 쉽게 로그인 창을 검색 할 수 있음을 알고 있습니다. 그러나 몇 가지 특별한 이유 때문에 Windows 로그인을 검색하고 익명 사용자를 허용하고 싶습니다. 따라서 Windows 로그인이 내 데이터베이스의 사용자 인 경우 다른 웹 페이지로 리디렉션됩니다.
나는 것을 ckecked했다 : (그러나 windowsLogin == 항상 빈)
ASP-C 번호
string windowsLogin = System.Security.Principal.WindowsPrincipal.Current.Identity.Name;
string windowsLogin = System.Threading.Thread.CurrentPrincipal.Identity.Name;
string windowsLogin = System.Net.CredentialCache.DefaultCredentials.ToString();
string windowsLogin = Request.ServerVariables["LOGON_USER"].ToString();
의 Web.config
<authorization>
<deny users ="?" /><!-- Deny acces to anonymous users-->
<allow users ="*" /><!-- Allow acces to every users-->
</authorization>
<identity impersonate="true"/>
<authentication mode="Forms">
<forms loginUrl="./WebLogin.aspx" defaultUrl="./default.aspx" timeout="12" path="/" name=".ASPXFORMSAUTH" slidingExpiration="true" />
</authentication>
이 클래식 ASP와는 아무 상관이 없다 -의 닷넷 질문 – John
내가 태그를 추가 코멘트 주셔서 감사를 그물. –