summaryrefslogtreecommitdiffstats
path: root/src/DotNetOAuth/Consumer.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2008-10-09 07:16:47 -0700
committerAndrew <andrewarnott@gmail.com>2008-10-09 07:23:38 -0700
commit50e231ec535e08c2bd5552100a0b3b7feb613f22 (patch)
tree26ab01c083c89336e8f1a0a987c56579b1e602b1 /src/DotNetOAuth/Consumer.cs
parent8586edc4c9d62f6241d2db66036ffb687deabadb (diff)
downloadDotNetOpenAuth-50e231ec535e08c2bd5552100a0b3b7feb613f22.zip
DotNetOpenAuth-50e231ec535e08c2bd5552100a0b3b7feb613f22.tar.gz
DotNetOpenAuth-50e231ec535e08c2bd5552100a0b3b7feb613f22.tar.bz2
Renamed a few OAuth messages and a few more methods.
Diffstat (limited to 'src/DotNetOAuth/Consumer.cs')
-rw-r--r--src/DotNetOAuth/Consumer.cs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/DotNetOAuth/Consumer.cs b/src/DotNetOAuth/Consumer.cs
index 0fc511a..9000a08 100644
--- a/src/DotNetOAuth/Consumer.cs
+++ b/src/DotNetOAuth/Consumer.cs
@@ -146,7 +146,7 @@ namespace DotNetOAuth {
/// <returns>The access token assigned by the Service Provider.</returns>
public GrantAccessTokenMessage ProcessUserAuthorization(string requestToken) {
string requestTokenSecret = this.TokenManager.GetTokenSecret(requestToken);
- var requestAccess = new RequestAccessTokenMessage(this.ServiceProvider.AccessTokenEndpoint) {
+ var requestAccess = new GetAccessTokenMessage(this.ServiceProvider.AccessTokenEndpoint) {
RequestToken = requestToken,
TokenSecret = requestTokenSecret,
ConsumerKey = this.ConsumerKey,
@@ -164,8 +164,8 @@ namespace DotNetOAuth {
/// <param name="endpoint">The URL and method on the Service Provider to send the request to.</param>
/// <param name="accessToken">The access token that permits access to the protected resource.</param>
/// <returns>The initialized WebRequest object.</returns>
- public WebRequest CreateAuthorizedRequest(MessageReceivingEndpoint endpoint, string accessToken) {
- IDirectedProtocolMessage message = this.CreateAuthorizedRequestInternal(endpoint, accessToken);
+ public WebRequest PrepareAuthorizedRequest(MessageReceivingEndpoint endpoint, string accessToken) {
+ IDirectedProtocolMessage message = this.CreateAuthorizingMessage(endpoint, accessToken);
HttpWebRequest wr = this.Channel.InitializeRequest(message);
return wr;
}
@@ -178,8 +178,8 @@ namespace DotNetOAuth {
/// <param name="accessToken">The access token that permits access to the protected resource.</param>
/// <returns>The initialized WebRequest object.</returns>
/// <exception cref="WebException">Thrown if the request fails for any reason after it is sent to the Service Provider.</exception>
- public Response SendAuthorizedRequest(MessageReceivingEndpoint endpoint, string accessToken) {
- IDirectedProtocolMessage message = this.CreateAuthorizedRequestInternal(endpoint, accessToken);
+ public Response PrepareAuthorizedRequestAndSend(MessageReceivingEndpoint endpoint, string accessToken) {
+ IDirectedProtocolMessage message = this.CreateAuthorizingMessage(endpoint, accessToken);
HttpWebRequest wr = this.Channel.InitializeRequest(message);
return this.WebRequestHandler.GetResponse(wr);
}
@@ -198,12 +198,12 @@ namespace DotNetOAuth {
/// <returns>The pending user agent redirect based message to be sent as an HttpResponse.</returns>
internal Response RequestUserAuthorization(Uri callback, IDictionary<string, string> requestParameters, IDictionary<string, string> redirectParameters, out string token) {
// Obtain an unauthorized request token.
- var requestToken = new RequestTokenMessage(this.ServiceProvider.RequestTokenEndpoint) {
+ var requestToken = new GetRequestTokenMessage(this.ServiceProvider.RequestTokenEndpoint) {
ConsumerKey = this.ConsumerKey,
ConsumerSecret = this.ConsumerSecret,
};
requestToken.AddNonOAuthParameters(requestParameters);
- var requestTokenResponse = this.Channel.Request<UnauthorizedRequestTokenMessage>(requestToken);
+ var requestTokenResponse = this.Channel.Request<GrantRequestTokenMessage>(requestToken);
this.TokenManager.StoreNewRequestToken(requestToken, requestTokenResponse);
// Request user authorization.
@@ -238,7 +238,7 @@ namespace DotNetOAuth {
/// <param name="endpoint">The URL and method on the Service Provider to send the request to.</param>
/// <param name="accessToken">The access token that permits access to the protected resource.</param>
/// <returns>The initialized WebRequest object.</returns>
- internal AccessProtectedResourcesMessage CreateAuthorizedRequestInternal(MessageReceivingEndpoint endpoint, string accessToken) {
+ internal AccessProtectedResourceMessage CreateAuthorizingMessage(MessageReceivingEndpoint endpoint, string accessToken) {
if (endpoint == null) {
throw new ArgumentNullException("endpoint");
}
@@ -246,7 +246,7 @@ namespace DotNetOAuth {
throw new ArgumentNullException("accessToken");
}
- AccessProtectedResourcesMessage message = new AccessProtectedResourcesMessage(endpoint) {
+ AccessProtectedResourceMessage message = new AccessProtectedResourceMessage(endpoint) {
AccessToken = accessToken,
TokenSecret = this.TokenManager.GetTokenSecret(accessToken),
ConsumerKey = this.ConsumerKey,