通过HTTP头将值从一个ASP.NET应用传递给另一个 [英] Pass value from one ASP.NET app to another via HTTP Header

查看:115
本文介绍了通过HTTP头将值从一个ASP.NET应用传递给另一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在企业环境中实施单点登录机制,其中令牌在使用HTTP标头的应用程序之间共享。现在,为了进行集成测试,我需要编写一个应用程序来模拟这一点。



有什么方法可以在ASP.NET中重定向到另一个网页,并在流程中传递一个自定义的HTTP头文件?



谢谢 您需要在 Site B 上创建一个页面, 网站A 也会重定向用户,以设置所需的值。

例如,



http:/ /siteb.com/authenticate.aspx?authtoken=15128901428901428904jasklads&returnUrl=http://siteb.com/index.aspx



authenticate.aspx会设置一个cookie,然后每个请求都会收到authtoken。


We are implementing a single sign on mechanism in an enterprise environment, where the token is shared between applications using HTTP header. Now, in order to do the integration test, I need to write an application to simulate this.

Is there any way in ASP.NET where I can redirect to another web-page and pass a custom HTTP header in the process?

Thanks

解决方案

You need to create a page on Site B that Site A redirects the user too that sets a cookie with the desired value.

for instance.

http://siteb.com/authenticate.aspx?authtoken=15128901428901428904jasklads&returnUrl=http://siteb.com/index.aspx

authenticate.aspx would set a cookie and then every request would receive authtoken.

这篇关于通过HTTP头将值从一个ASP.NET应用传递给另一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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