after federated authentication, redirect to originally requested url

て烟熏妆下的殇ゞ 提交于 2019-12-05 19:12:34

It's up to your app to remember context info like this in the wctx param. If you're using WIF in the RP then this should be done automatically.

I figured out what was happening. I am using WIF and as Brock's answer suggested it should be doing everything itself...and it was.

Normally if you request a url like: http://domain.com/page and the 'Redirect To'/ReplyTo setting in ThinkTecture is just http://domain.com/.

Then when WIF calls out to the STS, it takes the path of the requested domain, in this case /path and adds it to the &ru param within the &wctx param. The &wctx param will look like this: rm=0&id=passive&ru=%2fpage.

Then after the STS has authenticated it redirects the user back to the ReplyTo url, http://domain.com with a body parameter of wctx and WIF picks this up and uses the ru param to do another redirect.

The problem is that my requested url was http://domain.com/#page and WIF doesn't include the #page in the ru param. So my ru param was just /, so it kept redirecting to http://domain.com which there was correct (yet incorrect).

Guess I need to set the ru value myself with the full URL... unless there is a better way.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!