diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2010-03-28 09:28:41 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2010-03-30 21:38:26 -0700 |
commit | d70e05fb90aa2d7acd01043913c34644123cbce7 (patch) | |
tree | 31b6f0ebad26105d1a8acce9368319558d8a366e /samples | |
parent | c5e8202e9a6b5c5dea1402facab24ca45d29bf14 (diff) | |
download | DotNetOpenAuth-d70e05fb90aa2d7acd01043913c34644123cbce7.zip DotNetOpenAuth-d70e05fb90aa2d7acd01043913c34644123cbce7.tar.gz DotNetOpenAuth-d70e05fb90aa2d7acd01043913c34644123cbce7.tar.bz2 |
Fixed signature verification when claimed_id has capital scheme or host name, or has path segments that end with a period under partial trust.
Diffstat (limited to 'samples')
-rw-r--r-- | samples/OpenIdOfflineProvider/MainWindow.xaml | 1 | ||||
-rw-r--r-- | samples/OpenIdOfflineProvider/MainWindow.xaml.cs | 11 |
2 files changed, 9 insertions, 3 deletions
diff --git a/samples/OpenIdOfflineProvider/MainWindow.xaml b/samples/OpenIdOfflineProvider/MainWindow.xaml index 8b3510f..e8677a7 100644 --- a/samples/OpenIdOfflineProvider/MainWindow.xaml +++ b/samples/OpenIdOfflineProvider/MainWindow.xaml @@ -25,6 +25,7 @@ <Expander Grid.Row="2" Grid.ColumnSpan="2" Header="Advanced options"> <StackPanel Margin="3"> <CheckBox Name="directedIdentityTrailingPeriodsCheckbox">Directed identity uses trailing periods in path</CheckBox> + <CheckBox Name="capitalizedHostName">Directed identity uses capitalized host name in claimed identifier</CheckBox> </StackPanel> </Expander> <TextBox Height="auto" Margin="0,8,0,0" Grid.Row="3" Grid.ColumnSpan="2" Name="logBox" IsReadOnly="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Auto" /> diff --git a/samples/OpenIdOfflineProvider/MainWindow.xaml.cs b/samples/OpenIdOfflineProvider/MainWindow.xaml.cs index bf88e78..86b6206 100644 --- a/samples/OpenIdOfflineProvider/MainWindow.xaml.cs +++ b/samples/OpenIdOfflineProvider/MainWindow.xaml.cs @@ -25,6 +25,7 @@ namespace DotNetOpenAuth.OpenIdOfflineProvider { using System.Windows.Navigation; using System.Windows.Shapes; using DotNetOpenAuth.Messaging; + using DotNetOpenAuth.OpenId; using DotNetOpenAuth.OpenId.Provider; using log4net; using log4net.Appender; @@ -117,11 +118,15 @@ namespace DotNetOpenAuth.OpenIdOfflineProvider { switch (checkidRequestList.SelectedIndex) { case 0: if (authRequest.IsDirectedIdentity) { + string userIdentityPageBase = this.hostedProvider.UserIdentityPageBase.AbsoluteUri; + if (capitalizedHostName.IsChecked.Value) { + userIdentityPageBase = (this.hostedProvider.UserIdentityPageBase.Scheme + Uri.SchemeDelimiter + this.hostedProvider.UserIdentityPageBase.Authority).ToUpperInvariant() + this.hostedProvider.UserIdentityPageBase.PathAndQuery; + } + string leafPath = "directedidentity"; if (directedIdentityTrailingPeriodsCheckbox.IsChecked.Value) { - authRequest.ClaimedIdentifier = this.hostedProvider.UserIdentityPageBase + "directedidentity."; - } else { - authRequest.ClaimedIdentifier = this.hostedProvider.UserIdentityPageBase + "directedidentity"; + leafPath += "."; } + authRequest.ClaimedIdentifier = Identifier.Parse(userIdentityPageBase + leafPath, true); authRequest.LocalIdentifier = authRequest.ClaimedIdentifier; } authRequest.IsAuthenticated = true; |