问题与返回URL授权问题MVC4 [英] Issue with return URL Authorize issue MVC4

查看:192
本文介绍了问题与返回URL授权问题MVC4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经写在MVC4一个应用程序,并部署到服务器。

I have written an application in MVC4 and deployed to the server.

我有即当用户尝试导航到具有[授权]属性本地URL的问题这将用户重定向到。

I am having an issue whereby when a user tries to navigate to a url that has the [Authorize] attribute locally this redirects the user to.

/Account/Login?ReturnUrl=%2fEvents%2fCreateEvent

但在服务器上我发现,这是增加了一些额外字符的URL的开始?

However on the server I am finding that this is adding some extra characters to the start of the url?

/~/Account/Login?ReturnUrl=%2fEvents%2fCreateEvent

这是由于抛出404异常 /〜/

This is throwing a 404 exception due to the /~/

当用户进行身份验证并导航到活动/ CreateEvent 那么这正常工作,当他们没有失败,但是!

When the user is authenticated and navigates to Events/CreateEvent then this works correctly, however fails when they are not!

有谁知道为什么吗?

推荐答案

你检查窗体身份验证设置web.config中。

Have you checked the web.config for the forms authentication setup.

看起来有点像这样。

<authentication mode="Forms">
      <forms loginUrl="~/Account/Login" timeout="2880" />
</authentication>

尝试取出波浪号

这篇关于问题与返回URL授权问题MVC4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆