summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientBase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientBase.cs')
-rw-r--r--src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientBase.cs29
1 files changed, 12 insertions, 17 deletions
diff --git a/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientBase.cs b/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientBase.cs
index 271a87e..2cfaede 100644
--- a/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientBase.cs
+++ b/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientBase.cs
@@ -53,23 +53,13 @@ namespace DotNetOpenAuth.OAuth2 {
/// <summary>
/// Gets or sets the identifier by which this client is known to the Authorization Server.
/// </summary>
- public string ClientIdentifier {
- get { return this.OAuthChannel.ClientIdentifier; }
- set { this.OAuthChannel.ClientIdentifier = value; }
- }
+ public string ClientIdentifier { get; set; }
/// <summary>
/// Gets or sets the tool to use to apply client credentials to authenticated requests to the Authorization Server.
/// </summary>
/// <value>May be <c>null</c> if this client has no client secret.</value>
- public ClientCredentialApplicator ClientCredentialApplicator {
- get { return this.OAuthChannel.ClientCredentialApplicator; }
- set { this.OAuthChannel.ClientCredentialApplicator = value; }
- }
-
- internal IOAuth2ChannelWithClient OAuthChannel {
- get { return (IOAuth2ChannelWithClient)this.Channel; }
- }
+ public ClientCredentialApplicator ClientCredentialApplicator { get; set; }
/// <summary>
/// Adds the necessary HTTP Authorization header to an HTTP request for protected resources
@@ -283,9 +273,18 @@ namespace DotNetOpenAuth.OAuth2 {
}
/// <summary>
+ /// Applies the default client authentication mechanism given a client secret.
+ /// </summary>
+ /// <param name="secret">The client secret. May be <c>null</c></param>
+ /// <returns>The client credential applicator.</returns>
+ protected static ClientCredentialApplicator DefaultSecretApplicator(string secret) {
+ return secret == null ? ClientCredentialApplicator.NoSecret() : ClientCredentialApplicator.SecretParameter(secret);
+ }
+
+ /// <summary>
/// Applies any applicable client credential to an authenticated outbound request to the authorization server.
/// </summary>
- /// <param name="request"></param>
+ /// <param name="request">The request to apply authentication information to.</param>
protected void ApplyClientCredential(AuthenticatedClientRequestBase request) {
Requires.NotNull(request, "request");
@@ -294,10 +293,6 @@ namespace DotNetOpenAuth.OAuth2 {
}
}
- protected static ClientCredentialApplicator DefaultSecretApplicator(string secret) {
- return secret == null ? ClientCredentialApplicator.NoSecret() : ClientCredentialApplicator.SecretParameter(secret);
- }
-
/// <summary>
/// Calculates the fraction of life remaining in an access token.
/// </summary>