diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2013-02-03 07:15:51 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2013-02-03 07:15:51 -0800 |
commit | a1009c6b185357d5a6a61a74ee3ceb572c7f5d5c (patch) | |
tree | bf8a6710acd4f7212af3eb00c39d6fd73fb81c6b /samples/OpenIdProviderMvc/Controllers | |
parent | 4ca9d9bb9c453a5929fbadf5332fa6845a66d042 (diff) | |
download | DotNetOpenAuth-a1009c6b185357d5a6a61a74ee3ceb572c7f5d5c.zip DotNetOpenAuth-a1009c6b185357d5a6a61a74ee3ceb572c7f5d5c.tar.gz DotNetOpenAuth-a1009c6b185357d5a6a61a74ee3ceb572c7f5d5c.tar.bz2 |
Touch up on community contribution.
Diffstat (limited to 'samples/OpenIdProviderMvc/Controllers')
-rw-r--r-- | samples/OpenIdProviderMvc/Controllers/OpenIdController.cs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/samples/OpenIdProviderMvc/Controllers/OpenIdController.cs b/samples/OpenIdProviderMvc/Controllers/OpenIdController.cs index 04b54da..6abbe17 100644 --- a/samples/OpenIdProviderMvc/Controllers/OpenIdController.cs +++ b/samples/OpenIdProviderMvc/Controllers/OpenIdController.cs @@ -267,12 +267,13 @@ namespace OpenIdProviderMvc.Controllers { } Uri userLocalIdentifier = Models.User.GetClaimedIdentifierForUser(User.Identity.Name); - - return authReq.LocalIdentifier.ToString().ToLowerInvariant() == userLocalIdentifier.ToString().ToLowerInvariant() - || - authReq.LocalIdentifier.ToString().ToLowerInvariant() == PpidGeneration.PpidIdentifierProvider - .GetIdentifier(userLocalIdentifier, authReq.Realm) - .ToString().ToLowerInvariant(); + + // Assuming the URLs on the web server are not case sensitive (on Windows servers they almost never are), + // and usernames aren't either, compare the identifiers without case sensitivity. + // No reason to do this for the PPID identifiers though, since they *can* be case sensitive and are highly + // unlikely to be typed in by the user anyway. + return string.Equals(authReq.LocalIdentifier.ToString(), userLocalIdentifier.ToString(), StringComparison.OrdinalIgnoreCase) || + authReq.LocalIdentifier == PpidGeneration.PpidIdentifierProvider.GetIdentifier(userLocalIdentifier, authReq.Realm); } } } |