diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-04-03 07:56:31 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-04-03 07:56:31 -0700 |
commit | b57b266d009bbb019535202c76b0ab6d730c20b3 (patch) | |
tree | 8b63db114ef58ee1272e9c007a8deb387cbdb2d3 /samples/OpenIdProviderWebForms/Code/Util.cs | |
parent | 94efa56407a1ef7c7b323179c1ca30d51f959c6a (diff) | |
download | DotNetOpenAuth-b57b266d009bbb019535202c76b0ab6d730c20b3.zip DotNetOpenAuth-b57b266d009bbb019535202c76b0ab6d730c20b3.tar.gz DotNetOpenAuth-b57b266d009bbb019535202c76b0ab6d730c20b3.tar.bz2 |
Removed URLRewriter from OP sample, since it just generates confusion and is incomplete when it stops working when the site is hosted in IIS.
Diffstat (limited to 'samples/OpenIdProviderWebForms/Code/Util.cs')
-rw-r--r-- | samples/OpenIdProviderWebForms/Code/Util.cs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/samples/OpenIdProviderWebForms/Code/Util.cs b/samples/OpenIdProviderWebForms/Code/Util.cs index 6493e67..84d3c63 100644 --- a/samples/OpenIdProviderWebForms/Code/Util.cs +++ b/samples/OpenIdProviderWebForms/Code/Util.cs @@ -24,11 +24,14 @@ namespace OpenIdProviderWebForms.Code { } public static Identifier BuildIdentityUrl() { - string username = HttpContext.Current.User.Identity.Name; + return BuildIdentityUrl(HttpContext.Current.User.Identity.Name); + } - // be sure to normalize case the way the user's identity page does. + public static Identifier BuildIdentityUrl(string username) { + // This sample Provider has a custom policy for normalizing URIs, which is that the whole + // path of the URI be lowercase except for the first letter of the username. username = username.Substring(0, 1).ToUpperInvariant() + username.Substring(1).ToLowerInvariant(); - return new Uri(HttpContext.Current.Request.Url, HttpContext.Current.Response.ApplyAppPathModifier("~/user/" + username)); + return new Uri(HttpContext.Current.Request.Url, HttpContext.Current.Response.ApplyAppPathModifier("~/user.aspx/" + username)); } internal static void ProcessAuthenticationChallenge(IAuthenticationRequest idrequest) { |