나는 지금 며칠 동안 성공하지 못한 채 웹을 트롤링하고 있기 때문에 누군가가 다음 시나리오로 나를 도울 수 있기를 바랍니다.
내가 직면 한 시나리오는 사용자가 AD (Active Directory)에있는 경우 로그인 화면을 자동으로 우회하고 대시 보드로 직접 이동하는 방법입니다. 사용자가 존재하지 않는 경우, 즉 사용자에게 AD (Active Directory) 계정이없는 경우 사용자를 로그인 페이지로 리디렉션합니다.
첨부 된 사진은 과정을 더 잘 설명하기위한 것입니다.
"IIS Express"를 사용하여 ASP.NET MVC 4 웹 앱을 실행하면 사용자 이름과 도메인이 정확하며 내 자격 증명이 다음과 같은 경우에 정확하기 때문에 자동으로 로그인됩니다.
username => "username"
domain => "domain"
그러나 "로컬 IIS"에서 솔루션을 실행하면 IIS가 다음 자격 증명을 사용하여 로그인하기 때문에 자격 증명이 올바르지 않습니다.
web.config setting (identity impersonate="false")
username => "NT AUTHORITY\\IUSR"
domain => "IIS APPPOOL"
web.config setting (identity impersonate="true")
username => "NT AUTHORITY\\IUSR"
domain => "NT AUTHORITY"
[2017/11/15] 업데이트
기본 로깅을 구축했기 때문에 UserPrincipal.FindByIdentity에서 실패한 것처럼 보이므로 서버에서 실패한 위치를 더 잘 이해할 수 있습니다.
내가받은 오류는 "작업 오류가 발생했습니다."입니다.
관심있는 IIS의 설정은 다음과 같습니다.
"응용 프로그램 풀" 고급 설정 ...
Enable 32-Bit Applications = True
Identity = NetworkService
웹 사이트 인증 설정은 다음과 같습니다.
Anonymous Authentication = Disabled
ASP.NET Impersonation = Enabled
Basic Authentication = Disabled
Forms Authentication = Disabled
Windows Authentication = Enabled
[2017/11/16] 업데이트
IIS에서 가장을 해제하고 ID를 ApplicationPoolIdentity로 설정
내가 만든 로그 파일의 값은 다음과 같습니다.
[2017-11-16 07:17:52 AM] Windows username => username (e.g. jdoe)
[2017-11-16 07:17:52 AM] Domain => IIS APPPOOL
[2017-11-16 07:21:18 AM] Windows username => username (e.g. jdoe)
[2017-11-16 07:21:18 AM] Domain => IIS APPPOOL
[2017-11-16 07:23:38 AM] Windows username => username (e.g. jdoe)
[2017-11-16 07:23:38 AM] Domain => IIS APPPOOL
[2017/11/16] 솔루션
"응용 프로그램 풀" 고급 설정 ...
Enable 32-Bit Applications = True
Identity = NetworkService
웹 사이트 인증 설정은 다음과 같습니다.
Anonymous Authentication = Disabled
ASP.NET Impersonation = Disabled
Basic Authentication = Disabled
Forms Authentication = Disabled
Windows Authentication = Enabled
건배,
팀
로컬 ISS에서 Windows 인증을 활성화합니다. ISS 스크린 샷
이것은 지역 ISS와 관련된 문제를 해결할 것입니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다