0

我有一个用 C# 编写的 MVC 4 Web 应用程序,我在其中设置会话变量,重定向到另一个网站,该网站回调我的 Web 应用程序(我正在进行 OAuth 握手并将临时令牌放在我的会话中)和当重定向命中我的网络应用程序时,我尝试从会话中获取我的对象,但它是空的。

有没有做这样的事情的策略?

我可以发布我的代码,但它很复杂,所以让我们看看我首先得到什么样的响应。

请发布示例策略代码,asp.net/c# 对我来说是新的。

是的,我知道 mvc 4 包含 OAuth 示例,但我不能使用它们。

4

2 回答 2

0

It's not clear to me how your process works exactly. When you say "redirecting to another website which calls back to my web app" do you mean the remote website calls your app? Or that the user is redirected back to your site (which I assume has some token on the querystring?)

There are lots of good examples of how to use OAuth, but if you refuse to follow the typical methods, it will be a lot more difficult.

You need to provide more information on how your handshake works.

Without knowing more, all I can do is guess, in that a new session is being created because something is different about your callback request. You need to figure out what that is.

于 2012-09-08T20:39:09.710 回答
0

small work around would be, which i did in the past is send the session variable value in the query string, and when they redirect you can read the value again, This would be ideal if you are controlling both the sides.

于 2012-09-08T20:43:01.580 回答