如何屏蔽yii returnurll

mvc ReturnUrl=%2f,该如何解决 - ASP.NET当前位置:& &&&mvc ReturnUrl=%2f,该如何解决mvc ReturnUrl=%2f,该如何解决&&网友分享于:&&浏览:0次mvc ReturnUrl=%2f我的web.config配置如下
&&authentication&mode="Forms"&
&&&&&&&forms&loginUrl="~/Account/Login"&name=".ASPXAUTH"&timeout="43200"&defaultUrl="/Home/Index"&protection="All"&path="/"&requireSSL="false"&slidingExpiration="true"&enableCrossAppRedirects="false"&/&
&&&&&/authentication&
&&&&&anonymousIdentification&enabled="true"&/&
&&&&&authorization&
&&&&&&&deny&users="?"&&/deny&
&&&&&/authorization&
按理说这样配置应该没登陆ReturnUrl=Home/Index这样的,现在为什么会这样呢ReturnUrl=%2f&?如何解决呢?------解决思路----------------------没错吧
%2f&=&/------解决思路----------------------web.config加入
&add&key="autoFormsAuthentication"&value="false"&/&
&add&key="enableSimpleMembership"&value="false"/&
12345678910
12345678910
12345678910 上一篇:下一篇:文章评论相关解决方案 12345678910 Copyright & &&版权所有I've started a new MVC 5 site, using the new Asp.Net Identity with Owin. In my "account" controller which has the attribute [Authorize], I have fai
// GET: /User/Login
[AllowAnonymous]
public ActionResult Login(string returnUrl)
ViewBag.ReturnUrl = returnU
return View();
// POST: /User/Login
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task&ActionResult& Login(LoginViewModel model, string returnUrl)
if (ModelState.IsValid)
var userApi = new UserService();
var apiUser = await userApi.LogIn(UserManager, model.CardNumber, model.Pin, model.RememberMe);
if (apiUser != null)
await SignInAsync(apiUser, model.RememberMe);
if (string.IsNullOrEmpty(returnUrl))
return RedirectToAction("UserLoggedIn", "User");
ModelState.AddModelError("", "Invalid username or password.");
catch (Exception ex)
Trace.TraceError("Cannot login {0}", ex.ToString());
Response.AppendToLog(ex.ToString());
ModelState.AddModelError("", ex.ToString());
// If we got this far, something failed, redisplay form
return View(model);
My question is in regards to the returnUrl behavior, the code above works in the sense that, if a user is not logged in and calls a action in a controller that has the attribute [Authorize], it gets sent to the login actions above and then returned to the controller/action that was requested. Which is great, BUT how?? And is it safe?
In this article about ""(for earlier versions of Asp.Net MVC) the recommendation is to do a check on the returnUrl that it's a local url before doing the redirect, is that something I should still do or is it now handled by the framework?
解决方案 You need to check if the url is local indeed using this method (it is not handled by the framework automatically):
if (!string.IsNullOrEmpty(returnUrl) && Url.IsLocalUrl(returnUrl))
return Redirect(returnUrl);
本文地址: &
我已经开始了一个新的MVC 5个网站,使用新的Asp.Net身份与Owin。在我的“账户”控制器,它具有属性[授权],我有相当标准的行为;
// GET:/用户/登录
[使用AllowAnonymous]
公众的ActionResult登录(字符串RETURNURL)
ViewBag.ReturnUrl = RETURNURL;
返回查看();
}// POST:/用户/登录
[HttpPost]
[使用AllowAnonymous]
[ValidateAntiForgeryToken]
公共异步任务<&的ActionResult GT;登录(LoginViewModel型号,串RETURNURL)
如果(ModelState.IsValid)
VAR userApi =新UserService();
VAR apiUser =等待userApi.LogIn(的UserManager,model.CardNumber,model.Pin,model.RememberMe);
如果(apiUser!= NULL)
等待SignInAsync(apiUser,model.RememberMe);
如果(string.IsNullOrEmpty(RETURNURL))
返回RedirectToAction(“UserLoggedIn”,“用户”);
ModelState.AddModelError(“”,“无效的用户名或密码。”);
赶上(异常前)
Trace.TraceError(“无法登录{0}”,ex.ToString());
Response.AppendToLog(ex.ToString());
ModelState.AddModelError(“”,ex.ToString());
//如果我们走到这一步,事情失败了,重新显示形式
返回查看(模型);
} 我的问题是关于在RETURNURL行为中,code以上,如果用户没有登录并调用具有属性[授权]控制器的动作在这个意义上的作品,它被发送到登录操作上面,然后返回到被请求的控制器/动作。这是伟大的,但如何?而且它是安全?在这篇文章中关于“ 如果(string.IsNullOrEmpty(RETURNURL)及!&安培; Url.IsLocalUrl(RETURNURL)){
返回重定向(RETURNURL);}
本文地址: &
扫一扫关注官方微信查看: 1361|回复: 5
京东登录疑问
阅读权限30
在线时间 小时
签到天数:6 天结帖率: (39/47)
/new/login.aspx?ReturnUrl=http%3A%2F%%2F%3Fcu%3Dtrue%26utm_source%3Dbaidu-pinzhuan%26utm_medium%3Dcpc%26utm_campaign%3Dt__baidupinzhuan%26utm_term%3D0f3d30c8dbaeb5eba8ac7d_0_1cf19b10f84fc304c1915aab
/uc/login?ltype=logout
vbdbnhnhlv----yuan7777 帐号密码
这2个 地址 在网页 上面 都可以登录 可是为什么 在代码里面 写短的网址就登录不成功&&长的就成功&&其他代码都是一样的 为什么那里问题
(157.77 KB, 下载次数: 40)
16:49 上传
点击文件名下载附件
我这怎么可以呢
回答提醒:如果本帖被关闭无法回复,您有更好的答案帮助楼主解决,请发表至
可获得加分喔。友情提醒:本版被采纳的主题可在
帖子申请荣誉值,获得 1点 荣誉值,荣誉值可兑换终身vip用户组哦。快捷通道: →
阅读权限130
在线时间 小时
签到天数: 27 天结帖率: (13/13)
我这怎么可以呢
热心帮助他人,荣誉+1,希望继续努力(*^__^*) 嘻嘻!
阅读权限30
在线时间 小时
签到天数: 6 天结帖率: (39/47)
我这怎么可以呢
你把源码替换短的网址看看 不行啊
阅读权限130
在线时间 小时
签到天数: 27 天结帖率: (13/13)
你把源码替换短的网址看看 不行啊
替换了也返回的成功哇
补充内容 ( 17:15):
返回的都是Success xxxxx....
阅读权限90
在线时间 小时
签到天数: 21 天结帖率: (2/2)
京东登录很简单的.加密都没有..你要抓个数据包看下吧,
你这个短的.应该要跳转一下吧.
在线时间 小时
头像被屏蔽
结帖率: (4/4)
重定向????
拒绝任何人以任何形式在本论坛发表与中华人民共和国法律相抵触的言论,本站内容均为会员发表,并不代表精易立场!
揭阳精易科技有限公司申明:我公司所有的培训课程版权归精易所有,任何人以任何方式翻录、盗版、破解本站培训课程,我们必将通过法律途径解决!
公司简介:揭阳市揭东区精易科技有限公司致力于易语言教学培训/易语言学习交流社区的建设与软件开发,多年来为中小企业编写过许许多多各式软件,并把多年积累的开发经验逐步录制成视频课程供学员学习,让学员全面系统化学习易语言编程,少走弯路,减少对相关技术的研究与摸索时间,从而加快了学习进度!
Powered byWSFederationAuthenticationModule.CreateSignInRequest 方法 (Microsoft.IdentityModel.Web)
CreateSignInRequest 方法
WSFederationAuthenticationModule.CreateSignInRequest 方法
Windows Identity Foundation
Creates a WS-Federation Passive Protocol SignIn Request, using the WS-Federation parameters configured on the module.
命名空間: Microsoft.IdentityModel.Web組件: Microsoft.IdentityModel (在 microsoft.identitymodel.dll 中)Dim instance As
Dim uniqueId As
Dim returnUrl As
Dim rememberMeSet As
Dim returnValue As
returnValue = instance.CreateSignInRequest(uniqueId, returnUrl, rememberMeSet)
public SignInRequestMessage CreateSignInRequest (
string uniqueId,
string returnUrl,
bool rememberMeSet
public SignInRequestMessage CreateSignInRequest (
String uniqueId,
String returnUrl,
boolean rememberMeSet
public function CreateSignInRequest (
uniqueId : String,
returnUrl : String,
rememberMeSet : boolean
) : SignInRequestMessage
uniqueId returnUrl rememberMeSet Returns an instance of the
representing the WS-Federation Passive Protocol SignIn Request.
If you need to create a new sign in request, for example to redirect to different issuers based on the web page being accessed you can use this method to create the sign in request. Before calling this method, set the appropriate parameters on the FederatedAuthenticationModule.
任何這個類型的公用靜態 (在 Visual Basic 中為 共用) 成員都具備執行緒安全。不保證任何執行個體成員都具備執行緒安全。
Windows Server 2003, Windows Vista
Windows Server 2008, Windows Vista, Not tested on Windows XP
本頁對您有幫助嗎?
其他意見反應?
剩餘 1500 個字元
我們非常感謝您提供的意見反應。http://xxx.xxx.x.xxx/login.aspx?ReturnUrl=%2fDefault.aspx我要怎么做才能这样
http://xxx.xxx.x.xxx/login.aspx?ReturnUrl=%2fDefault.aspx我要怎么做才能这样
昵称: ylly11111 &时间:
昵称: LMAOhuaNL &时间:
昵称: maco_wang &时间:
昵称: ylly11111 &时间:
昵称: ylly11111 &时间:

我要回帖

更多关于 yii returnurl 的文章

 

随机推荐