diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-12-15 22:17:20 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-12-15 22:17:20 -0800 |
commit | e12782c1a6727390b2107ff2e39d4ac6173d86fc (patch) | |
tree | 3be0ccda0a9425927263f5b6b9616ef8ba11ac08 /samples/ProviderPortal/user.aspx.cs | |
parent | 078b1f350eb40ceee7423c25b1d833dd1f242da4 (diff) | |
parent | a545f7be2693596fa14540c359e43150a6a7cf88 (diff) | |
download | DotNetOpenAuth-origin/mono.zip DotNetOpenAuth-origin/mono.tar.gz DotNetOpenAuth-origin/mono.tar.bz2 |
Merge branch 'v2.5' into monoorigin/mono
Conflicts:
src/DotNetOpenId/Properties/AssemblyInfo.cs
src/DotNetOpenId/RelyingParty/AuthenticationResponse.cs
Diffstat (limited to 'samples/ProviderPortal/user.aspx.cs')
-rw-r--r-- | samples/ProviderPortal/user.aspx.cs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/samples/ProviderPortal/user.aspx.cs b/samples/ProviderPortal/user.aspx.cs index 5400200..744cae5 100644 --- a/samples/ProviderPortal/user.aspx.cs +++ b/samples/ProviderPortal/user.aspx.cs @@ -1,5 +1,5 @@ using System;
-using System.Configuration;
+using DotNetOpenId.Provider;
/// <summary>
/// This page is a required as part of the service discovery phase of the openid protocol (step 1).
@@ -18,4 +18,15 @@ public partial class user : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) {
usernameLabel.Text = Request.QueryString["username"];
}
+
+ protected void IdentityEndpoint20_NormalizeUri(object sender, IdentityEndpointNormalizationEventArgs e) {
+ // 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.
+ UriBuilder normalized = new UriBuilder(e.UserSuppliedIdentifier);
+ string username = Request.QueryString["username"].TrimEnd('/').ToLowerInvariant();
+ username = username.Substring(0, 1).ToUpperInvariant() + username.Substring(1);
+ normalized.Path = "/user/" + username;
+ normalized.Scheme = "http"; // for a real Provider, this should be HTTPS if supported.
+ e.NormalizedIdentifier = normalized.Uri;
+ }
}
|