diff options
-rw-r--r-- | samples/OAuthConsumerWpf/MainWindow.xaml | 52 | ||||
-rw-r--r-- | samples/OAuthConsumerWpf/MainWindow.xaml.cs | 3 | ||||
-rw-r--r-- | src/DotNetOpenAuth/OAuthWrap/IClientTokenManager.cs | 42 |
3 files changed, 96 insertions, 1 deletions
diff --git a/samples/OAuthConsumerWpf/MainWindow.xaml b/samples/OAuthConsumerWpf/MainWindow.xaml index c59175c..32cd758 100644 --- a/samples/OAuthConsumerWpf/MainWindow.xaml +++ b/samples/OAuthConsumerWpf/MainWindow.xaml @@ -133,5 +133,55 @@ <TextBox Grid.Column="0" Grid.Row="8" Grid.ColumnSpan="3" Name="resultsBox" IsReadOnly="True" /> </Grid> </TabItem> - </TabControl> + <TabItem Header="Generic WRAP"> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="auto" /> + <RowDefinition Height="auto" /> + <RowDefinition Height="auto" /> + <RowDefinition Height="auto" /> + <RowDefinition Height="auto" /> + <RowDefinition Height="auto" /> + <RowDefinition Height="auto" /> + <RowDefinition Height="auto" /> + <RowDefinition Height="*" /> + </Grid.RowDefinitions> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="auto" /> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="auto" /> + </Grid.ColumnDefinitions> + <Label Grid.Row="0">Access Token URL</Label> + <TextBox Grid.Column="1" x:Name="wrapAccessTokenUrlBox" /> + <Label Grid.Column="2">POST</Label> + <Label Grid.Row="1">Refresh Token URL</Label> + <TextBox Grid.Row="1" Grid.Column="1" x:Name="wrapRefreshTokenUrlBox" /> + <Label Grid.Row="1" Grid.Column="2">POST</Label> + <Label Grid.Row="2">User Authorization URL</Label> + <TextBox Grid.Row="2" Grid.Column="1" x:Name="wrapUserAuthorizationUrlBox" /> + <Label Grid.Row="2" Grid.Column="2">GET</Label> + <Label Grid.Row="3">Resource URL</Label> + <TextBox Grid.Row="3" Grid.Column="1" x:Name="wrapResourceUrlBox" /> + <ComboBox Grid.Row="3" Grid.Column="2" x:Name="wrapResourceHttpMethodList" SelectedIndex="0"> + <ComboBox.Items> + <ComboBoxItem>GET w/ header</ComboBoxItem> + <ComboBoxItem>GET w/ querystring</ComboBoxItem> + <ComboBoxItem>POST</ComboBoxItem> + </ComboBox.Items> + </ComboBox> + <Label Grid.Row="4">Client Identifier</Label> + <TextBox Grid.Row="4" Grid.Column="1" x:Name="wrapClientIdentifierBox" Grid.ColumnSpan="2"/> + <Label Grid.Row="5">Client Secret</Label> + <TextBox Grid.Row="5" Grid.Column="1" x:Name="wrapClientSecretBox" Grid.ColumnSpan="2"/> + <Label Grid.Row="6">WRAP version</Label> + <ComboBox Grid.Row="6" Grid.Column="1" SelectedIndex="0" x:Name="wrapVersion"> + <ComboBox.Items> + <ComboBoxItem>1.0 early DRAFT</ComboBoxItem> + </ComboBox.Items> + </ComboBox> + <Button Grid.Row="7" Grid.Column="1" x:Name="wrapBeginButton" Click="wrapBeginButton_Click">Begin</Button> + <TextBox Grid.Column="0" Grid.Row="8" Grid.ColumnSpan="3" Name="wrapResultsBox" IsReadOnly="True" /> + </Grid> + </TabItem> + </TabControl> </Window> diff --git a/samples/OAuthConsumerWpf/MainWindow.xaml.cs b/samples/OAuthConsumerWpf/MainWindow.xaml.cs index c917288..8c8d035 100644 --- a/samples/OAuthConsumerWpf/MainWindow.xaml.cs +++ b/samples/OAuthConsumerWpf/MainWindow.xaml.cs @@ -198,5 +198,8 @@ MessageBox.Show(this, ex.Message); } } + + private void wrapBeginButton_Click(object sender, RoutedEventArgs e) { + } } } diff --git a/src/DotNetOpenAuth/OAuthWrap/IClientTokenManager.cs b/src/DotNetOpenAuth/OAuthWrap/IClientTokenManager.cs index a51d2d6..1c25b21 100644 --- a/src/DotNetOpenAuth/OAuthWrap/IClientTokenManager.cs +++ b/src/DotNetOpenAuth/OAuthWrap/IClientTokenManager.cs @@ -13,6 +13,12 @@ namespace DotNetOpenAuth.OAuthWrap { [ContractClass(typeof(IClientTokenManagerContract))] public interface IClientTokenManager { + /// <summary> + /// Gets the state of the authorization for a given callback URL and client state. + /// </summary> + /// <param name="callbackUrl">The callback URL.</param> + /// <param name="clientState">State of the client stored at the beginning of an authorization request.</param> + /// <returns>The authorization state; may be <c>null</c> if no authorization state matches.</returns> IWrapAuthorization GetAuthorizationState(Uri callbackUrl, string clientState); } @@ -31,18 +37,54 @@ namespace DotNetOpenAuth.OAuthWrap { #endregion } + /// <summary> + /// Provides access to a persistent object that tracks the state of an authorization. + /// </summary> public interface IWrapAuthorization { + /// <summary> + /// Gets or sets the callback URL used to obtain authorization. + /// </summary> + /// <value>The callback URL.</value> Uri Callback { get; set; } + /// <summary> + /// Gets or sets the long-lived token used to renew the short-lived <see cref="AccessToken"/>. + /// </summary> + /// <value>The refresh token.</value> string RefreshToken { get; set; } + /// <summary> + /// Gets or sets the access token. + /// </summary> + /// <value>The access token.</value> string AccessToken { get; set; } + /// <summary> + /// Gets or sets the access token UTC expiration date. + /// </summary> DateTime? AccessTokenExpirationUtc { get; set; } + /// <summary> + /// Gets or sets the scope the token is (to be) authorized for. + /// </summary> + /// <value>The scope.</value> string Scope { get; set; } + /// <summary> + /// Deletes this authorization, including access token and refresh token were applicable. + /// </summary> + /// <remarks> + /// This method is invoked when an authorization attempt fails, is rejected, is revoked, or + /// expires and cannot be renewed. + /// </remarks> void Delete(); + + /// <summary> + /// Saves any changes made to this authorization object's properties. + /// </summary> + /// <remarks> + /// This method is invoked after DotNetOpenAuth changes any property. + /// </remarks> void SaveChanges(); } } |