Friday, September 12, 2008

How to make return url effect when using RPS 6.0 httpmodule

Problem:
Environment: IIS7, vista, RPS 6.0.5135.0

Repro:
1) Install rps;
2) Configure RPS http module according to RPS beta doc;
3) Register my site in MSM, providing return url as “….\landing.aspx”;
4) Configure rpsserver.xml, specifying the same return url in the site node;
5) Open ie and go to the un-authed page default.aspx;
6) Click sign in button;
7) On the signin page, you can see the return url embedded in the request url is “…\default.aspx” instead of “landing.aspx”.
8) After signin, it directs to default.aspx instead of landing.aspx.

I also tried this:
1) Open IE and go to landing.aspx;
2) Click sign in button;
3) On the signin page, you can see the return url embedded in the request url is “…\landing.aspx”;
4) After sign in, it directs to landing.aspx.

According to above repro, it sounds like WLID always use the incoming url to construct the return url and ignore any configured return url in my case.

I have downloaded the site xml and verified that the return url is landing.aspx.

How can I make the return url effect?


Solution:
Use PropBag when setting WLIDSignInOutLiteral.Text. The PropBag will load the configuration of this site node in rpsserver.xml. So if you set return url correctly in rpsserver.xml for this site, then it takes effect.

Microsoft.Passport.RPS.RPSPropBag authPropBag = LiveID.CreateNewRPSPropBag();
WLIDSignInOutLiteral.Text = LiveID.GetTextTag("Sitename", "nexus.passport-int.com/public/partner/rpsnetwork4.xml", authPropBag);

No comments: