MVC 3이 서버에 설치되었으므로 / Account / Login? ReturnUrl = % 2f로 리디렉션 요청
Windows 2008 / IIS7 서버에서 실행되는 내부 ASP.NET Webforms 애플리케이션이 있으며 MVC3를 설치할 때까지 정상적으로 실행되었습니다.
이제 모든 요청이 / Account / Login? ReturnUrl = % 2f로 리디렉션됩니다.
웹 사이트는 MVC가 아닌 Webforms입니다. 내부 전용 사이트이기 때문에 루트 폴더에 대해 Windows 인증이 활성화되어 있습니다.
이 문제의 영향을받지 않은 동일한 서버에 여러 다른 웹 사이트가 있지만 루트 폴더가 Windows 인증으로 설정된 유일한 사이트입니다.
web.config 파일의 AppSettings 섹션에 다음 줄을 추가하여 문제를 해결했습니다.
<add key="autoFormsAuthentication" value="false" />
<add key="enableSimpleMembership" value="false"/>
나는 이것을 이렇게 고쳤다
- IIS로 이동
- 프로젝트 선택
- "인증"을 클릭하십시오.
- "익명 인증"> 편집을 클릭하고 "특정 사용자"대신 "응용 프로그램 풀 ID"를 선택합니다.
- 끝난.
MVC 4에 대한 업데이트 된 답변,이 페이지에서 많이 빌려 왔고 양식 인증 섹션 구성 과 관련된 ASP.NET MVC 문제 (두 페이지 모두에서 답변 됨)
<appSettings>
...
<add key="PreserveLoginUrl" value="true" />
</appSettings>
...
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="43200" /> <!--43,200 in minutes - 30 days-->
</authentication>
그냥 제거
<authorization>
<deny users="?"/>
</authorization>
web.config 파일에서
그것은 나를 위해했다
내 해결책은 태그를 추가하는 것이 었습니다.
[AllowAnonymous]
등록 페이지에 대한 내 GET 요청을 통해. 원래 내가 관리하던 코드에서 누락되었습니다!
옵션 defaultURL에 내 응용 프로그램 경로를 추가하여 해결하십시오.
<forms loginUrl="/Users/Login" protection="All" timeout="2880" name="001WVCookie" path="/" requireSSL="false" slidingExpiration="true" defaultUrl="/Home/Index" cookieless="UseCookies" enableCrossAppRedirects="false" />
IIS 요청이 기본 페이지 ( default.aspx
또는 로그인 페이지)로 자동 리디렉션되는 문제를 해결했습니다.
내 web.config
파일 의 AppSettings 섹션에 다음 줄을 추가 합니다.
<add key="autoFormsAuthentication" value="false" />
<add key="enableSimpleMembership" value="false"/>
일부 WCF SOAP 관련 사항을 기존 IIS 사이트에 추가했으며 이로 인해 사이트에서 web.config 인증 리디렉션을 거부하는 문제가 발생했습니다.
우리는 성공하지 못한 채 나열된 다양한 수정을 시도했고, 새로운 이상한 URL을 우리가 수년간 사용해온 URL에 다시 매핑하는 해결 방법을 발명했습니다.
<urlMappings enabled="true">
<add mappedUrl="~/loginout.aspx" url="~/Account/Login"/>
</urlMappings>
작동했지만 못 생겼습니다. 결국 우리는 얼마 전에 Visual Studio에서 추가 한 web.config 항목을 추적했습니다.
<add key="webpages:Enabled" value="true" />
그것이 무엇을하는지 정확히 알아낼 수 없었기 때문에 우리는 그것을 꺼내고 즉시 문제를 해결했습니다.
web.config를 열고 변경
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" />
</authentication>
에
<authentication mode="Forms">
<forms loginUrl="~/Login.aspx" timeout="2880" />
</authentication>
~ / Default.aspx로 변경
다음 사항에 유의하십시오.
RegisterGlobalFilters(GlobalFilterCollection filters) {
filters.Add(new System.Web.Mvc.AuthorizeAttribute());
}
After 4 hours, of trying everything... Windows 2008 R2 the files were green in Window Explorer. The files were marked for encryption and arching that came from the zip file. unchecking those options in the file property fixed the issue for me.
If nothing works then add authentication mode="Windows" in your system.web attribute in your Web.Config file. hope it will work for you.
Drezus - you solved it for me. Thanks so much.
In your AccountController, login should look like this:
[AllowAnonymous]
public ActionResult Login(string returnUrl)
{
ViewBag.ReturnUrl = returnUrl;
return View();
}
Similar setup, identical problem. Some installations would work, but most would start redirecting (http 302) to /Account/Login?ReturnUrl=%2f after a successful login, even though we're not using Forms Authentication. In my case after trying everything else, the solution was to switch the Application Pool Managed Pipeline Mode from from Integrated to Classic, which cleared up the problem immediately.
ReferenceURL : https://stackoverflow.com/questions/8205368/request-redirect-to-account-loginreturnurl-2f-since-mvc-3-install-on-server
'programing' 카테고리의 다른 글
데이터 소스의 SQL 언어를 구성해야하는 이유는 무엇입니까? (0) | 2021.01.16 |
---|---|
SharePoint 인터뷰 질문 (0) | 2021.01.16 |
사람이 읽을 수있는 파일 형식을 사용해야하는 이유는 무엇입니까? (0) | 2021.01.16 |
PowerShell에 상대 파일 포함 (0) | 2021.01.16 |
NSData를 NSString Hex 문자열로 변환하는 방법은 무엇입니까? (0) | 2021.01.16 |