diff options
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 5cec951..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, "/user/" + username); + return new Uri(HttpContext.Current.Request.Url, HttpContext.Current.Response.ApplyAppPathModifier("~/user.aspx/" + username)); } internal static void ProcessAuthenticationChallenge(IAuthenticationRequest idrequest) { |