diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2008-09-30 08:32:34 -0700 |
---|---|---|
committer | Andrew <andrewarnott@gmail.com> | 2008-10-02 07:33:59 -0700 |
commit | 1b9d589c7ed1cf7648ee7abc9150def40d6274b3 (patch) | |
tree | 0b8204759ba39cb96eca285d74488c91df7fb941 /src/DotNetOAuth/ServiceProvider.cs | |
parent | 08a2ca3fdbe337ba11575cf7893ab547536bb4e2 (diff) | |
download | DotNetOpenAuth-1b9d589c7ed1cf7648ee7abc9150def40d6274b3.zip DotNetOpenAuth-1b9d589c7ed1cf7648ee7abc9150def40d6274b3.tar.gz DotNetOpenAuth-1b9d589c7ed1cf7648ee7abc9150def40d6274b3.tar.bz2 |
StyleCop work and adding support for including extra parameters where the spec allows it.
Diffstat (limited to 'src/DotNetOAuth/ServiceProvider.cs')
-rw-r--r-- | src/DotNetOAuth/ServiceProvider.cs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/DotNetOAuth/ServiceProvider.cs b/src/DotNetOAuth/ServiceProvider.cs index 5d66639..44d64e4 100644 --- a/src/DotNetOAuth/ServiceProvider.cs +++ b/src/DotNetOAuth/ServiceProvider.cs @@ -12,6 +12,7 @@ namespace DotNetOAuth { using DotNetOAuth.Messages;
using DotNetOAuth.Messaging;
using DotNetOAuth.Messaging.Bindings;
+using System.Collections.Generic;
/// <summary>
/// A web application that allows access via OAuth.
@@ -79,7 +80,7 @@ namespace DotNetOAuth { return this.Channel.ReadFromRequest<RequestTokenMessage>(request);
}
- internal void SendUnauthorizedTokenResponse(RequestTokenMessage request) {
+ internal void SendUnauthorizedTokenResponse(RequestTokenMessage request, IDictionary<string, string> extraParameters) {
string token = this.TokenGenerator.GenerateRequestToken(request.ConsumerKey);
string secret = this.TokenGenerator.GenerateSecret();
this.TokenManager.StoreNewRequestToken(request.ConsumerKey, token, secret, null/*add params*/);
@@ -87,6 +88,7 @@ namespace DotNetOAuth { RequestToken = token,
TokenSecret = secret,
};
+ response.AddNonOAuthParameters(extraParameters);
this.Channel.Send(response);
}
@@ -127,7 +129,7 @@ namespace DotNetOAuth { return this.Channel.ReadFromRequest<RequestAccessTokenMessage>(request);
}
- internal void SendAccessToken(RequestAccessTokenMessage request) {
+ internal void SendAccessToken(RequestAccessTokenMessage request, IDictionary<string, string> extraParameters) {
if (!this.TokenManager.IsRequestTokenAuthorized(request.RequestToken)) {
throw new ProtocolException(
string.Format(
@@ -143,6 +145,7 @@ namespace DotNetOAuth { AccessToken = accessToken,
TokenSecret = tokenSecret,
};
+ grantAccess.AddNonOAuthParameters(extraParameters);
this.Channel.Send(grantAccess);
}
|