When an anonymous user views a protected view, asp.net automatically redirects them to the SignIn page and places ReturnUrl in querystring. You can save ReturnUrl by adding it to token_url used in the RPX login.
Here is the helper I created to create the correct href for iframe RPX on my SignIn page:
public static string RpxSignInUrl(this HtmlHelper htmlHelper)
{
string returnUrl = FormsAuthentication.GetRedirectUrl(
String.Empty,
false);
string tokenUrl = "http://<your-domain>/Account/RpxResponse?ReturnUrl=" +
HttpUtility.UrlEncode(returnUrl);
string realm = "<your-app-id>.rpxnow.com";
string signInUrl = String.Format(
CultureInfo.InvariantCulture,
"http://{0}/openid/embed?token_url={1}",
realm,
HttpUtility.UrlEncode(tokenUrl));
return signInUrl;
}
RPX URL-, ReturnUrl. FormsAuthentication.GetRedirectUrl URL-.
, API, Request.Querystring, URL-, , . URL- , asp.net defaultUrl, forms web.config.