MVC 2怎么去URL重定向没有? [英] MVC 2 how to go to url without redirecting?

查看:260
本文介绍了MVC 2怎么去URL重定向没有?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法去一个URL重定向没有给它?基本上,我想从我的后台应用程序中调用一个URL,因此它可以注销一个依赖方。

鸭preciate的帮助。


解决方案

你正在尝试做的不竞争,我们回答,因为它是直接关系到你自己的身份验证的实现。

一个正常的 ASP.NET验证基于表单认证,你需要的总是吃午饭的URL从浏览器,因为它是有依赖给出的验证。

您可以给自己一个尝试打开你的网站并登录进去,在那之后,打开浏览器的其他品牌(而不是浏览器窗口中)到你的应用网址...你会看到你也需要重新登录作为身份验证是挂接到第一个浏览器。

这是给你的应用程序架构师通过使这个消耗,你需要一个验证$ Web服务时实施认证的另一种方式后,通常在这个kind'a情况下,这happend C $ç第一,总是需要一个code被附加到身体或任何呼叫的头以系统

这样你就可以轻松去除认证code和所有过程调用都将失败。

至于说,这不取决于我们,这是由你来打造的正确的验证层


从您的评论

这是因为使用 WebClient的对象简单

  Web客户端的客户端=新的WebClient();
 串答复= client.DownloadString(地址);

Is there a way to go to a url without redirecting to it? Basically I want to call a url from within my application in the background so it can logout a reliant party.

Appreciate the help.

解决方案

What you are trying to do does not compete us to answer as it's directly related to your own Authentication implementation.

A normal ASP.NET Authentication based in Forms Authentication you will need always to lunch the url from a browser as it is there that relies the Authentication given.

You can give yourself a try by opening your website and log in into it, after that, open other browser brand (not browser window) into your application url... you will see that you also need to login again as the Authentication is hook up into the first browser.

It's Up to you as Application Architect to make this by implementing another way of authentication, normally in this kind'a cases, this happend when consuming web services where you need a authentication code first (given by calling a Login method) and that code is always needed to be appended to the body or header of any call to the system.

This way you can easily remove the authentication code and all procedure calls will fail.

As said, this is not up to us, it's up to you to create the correct Authentication Layer.


from your comment

it's as simple as using WebClient object

 WebClient client = new WebClient ();
 string reply = client.DownloadString (address);

这篇关于MVC 2怎么去URL重定向没有?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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