Skip to content
This repository has been archived by the owner on Mar 20, 2019. It is now read-only.

Commit

Permalink
Touch up on community contribution.
Browse files Browse the repository at this point in the history
  • Loading branch information
AArnott committed Feb 3, 2013
1 parent 4ca9d9b commit a1009c6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions samples/OpenIdProviderMvc/Controllers/OpenIdController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,13 @@ private bool UserControlsIdentifier(IAuthenticationRequest authReq) {
}

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);
}
}
}

0 comments on commit a1009c6

Please sign in to comment.