summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorunknown <andarno@.redmond.corp.microsoft.com>2010-06-22 08:49:25 -0700
committerunknown <andarno@.redmond.corp.microsoft.com>2010-06-22 08:49:25 -0700
commit4152ac9b105e7d2e15343c71d770bb658f972e27 (patch)
tree29ddbe2e3d321e1da75b41229ea933aa70b328d6
parent5844923f77789d2f58dd65e34e138753629a5d13 (diff)
downloadDotNetOpenAuth-4152ac9b105e7d2e15343c71d770bb658f972e27.zip
DotNetOpenAuth-4152ac9b105e7d2e15343c71d770bb658f972e27.tar.gz
DotNetOpenAuth-4152ac9b105e7d2e15343c71d770bb658f972e27.tar.bz2
Fixes support for OpenID RP controls' ReturnToUrl property to receive values starting with "~/"
Fixes Trac #204
-rw-r--r--src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.cs12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.cs b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.cs
index 5090ecd..380417f 100644
--- a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.cs
+++ b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.cs
@@ -914,16 +914,22 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
// Approximate the returnTo (either based on the customize property or the page URL)
// so we can use it to help with Realm resolution.
- Uri returnToApproximation = this.ReturnToUrl != null ? new Uri(this.RelyingParty.Channel.GetRequestFromContext().UrlBeforeRewriting, this.ReturnToUrl) : this.Page.Request.Url;
+ Uri returnToApproximation;
+ if (this.ReturnToUrl != null) {
+ string returnToResolvedPath = this.ResolveUrl(this.ReturnToUrl);
+ returnToApproximation = new Uri(this.RelyingParty.Channel.GetRequestFromContext().UrlBeforeRewriting, returnToResolvedPath);
+ } else {
+ returnToApproximation = this.Page.Request.Url;
+ }
// Resolve the trust root, and swap out the scheme and port if necessary to match the
- // return_to URL, since this match is required by OpenId, and the consumer app
+ // return_to URL, since this match is required by OpenID, and the consumer app
// may be using HTTP at some times and HTTPS at others.
UriBuilder realm = OpenIdUtilities.GetResolvedRealm(this.Page, this.RealmUrl, this.RelyingParty.Channel.GetRequestFromContext());
realm.Scheme = returnToApproximation.Scheme;
realm.Port = returnToApproximation.Port;
- // Initiate openid request
+ // Initiate OpenID request
// We use TryParse here to avoid throwing an exception which
// might slip through our validator control if it is disabled.
Realm typedRealm = new Realm(realm);