summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2008-09-30 20:54:55 -0700
committerAndrew <andrewarnott@gmail.com>2008-10-02 07:34:03 -0700
commit8a00ff24f7dab5a27d5c3c9aefb852922e9b069c (patch)
tree6cbffa37bfcf39b1eecb95ca83732b6859d46c53
parentf6b7de466fb084a87c6de7a6d1e7f15db835bf20 (diff)
downloadDotNetOpenAuth-8a00ff24f7dab5a27d5c3c9aefb852922e9b069c.zip
DotNetOpenAuth-8a00ff24f7dab5a27d5c3c9aefb852922e9b069c.tar.gz
DotNetOpenAuth-8a00ff24f7dab5a27d5c3c9aefb852922e9b069c.tar.bz2
More public API work.
-rw-r--r--src/DotNetOAuth.Test/Scenarios/AppendixScenarios.cs2
-rw-r--r--src/DotNetOAuth/Consumer.cs8
-rw-r--r--src/DotNetOAuth/Messages/GrantAccessTokenMessage.cs4
-rw-r--r--src/DotNetOAuth/ServiceProvider.cs4
4 files changed, 9 insertions, 9 deletions
diff --git a/src/DotNetOAuth.Test/Scenarios/AppendixScenarios.cs b/src/DotNetOAuth.Test/Scenarios/AppendixScenarios.cs
index 66e8b5f..3df9aa7 100644
--- a/src/DotNetOAuth.Test/Scenarios/AppendixScenarios.cs
+++ b/src/DotNetOAuth.Test/Scenarios/AppendixScenarios.cs
@@ -40,7 +40,7 @@ namespace DotNetOAuth.Test {
channel => {
consumer.Channel = channel;
consumer.RequestUserAuthorization(new Uri("http://printer.example.com/request_token_ready"), null, null);
- string accessToken = consumer.ProcessUserAuthorization();
+ string accessToken = consumer.ProcessUserAuthorization().AccessToken;
var photoRequest = consumer.CreateAuthorizedRequestInternal(accessPhotoEndpoint, accessToken);
Response protectedPhoto = channel.RequestProtectedResource(photoRequest);
Assert.IsNotNull(protectedPhoto);
diff --git a/src/DotNetOAuth/Consumer.cs b/src/DotNetOAuth/Consumer.cs
index 436548e..aad9300 100644
--- a/src/DotNetOAuth/Consumer.cs
+++ b/src/DotNetOAuth/Consumer.cs
@@ -127,7 +127,7 @@ namespace DotNetOAuth {
/// <remarks>
/// Requires HttpContext.Current.
/// </remarks>
- public string ProcessUserAuthorization() {
+ public GrantAccessTokenMessage ProcessUserAuthorization() {
return this.ProcessUserAuthorization(this.Channel.GetRequestFromContext());
}
@@ -136,7 +136,7 @@ namespace DotNetOAuth {
/// </summary>
/// <param name="request">The incoming HTTP request.</param>
/// <returns>The access token, or null if no incoming authorization message was recognized.</returns>
- public string ProcessUserAuthorization(HttpRequest request) {
+ public GrantAccessTokenMessage ProcessUserAuthorization(HttpRequest request) {
return this.ProcessUserAuthorization(new HttpRequestInfo(request));
}
@@ -172,7 +172,7 @@ namespace DotNetOAuth {
/// </summary>
/// <param name="request">The incoming HTTP request.</param>
/// <returns>The access token, or null if no incoming authorization message was recognized.</returns>
- internal string ProcessUserAuthorization(HttpRequestInfo request) {
+ internal GrantAccessTokenMessage ProcessUserAuthorization(HttpRequestInfo request) {
DirectUserToConsumerMessage authorizationMessage;
if (this.Channel.TryReadFromRequest<DirectUserToConsumerMessage>(request, out authorizationMessage)) {
// Exchange request token for access token.
@@ -185,7 +185,7 @@ namespace DotNetOAuth {
};
var grantAccess = this.Channel.Request<GrantAccessTokenMessage>(requestAccess);
this.TokenManager.ExpireRequestTokenAndStoreNewAccessToken(this.ConsumerKey, authorizationMessage.RequestToken, grantAccess.AccessToken, grantAccess.TokenSecret);
- return grantAccess.AccessToken;
+ return grantAccess;
} else {
return null;
}
diff --git a/src/DotNetOAuth/Messages/GrantAccessTokenMessage.cs b/src/DotNetOAuth/Messages/GrantAccessTokenMessage.cs
index bbc44cc..504af4a 100644
--- a/src/DotNetOAuth/Messages/GrantAccessTokenMessage.cs
+++ b/src/DotNetOAuth/Messages/GrantAccessTokenMessage.cs
@@ -11,7 +11,7 @@ namespace DotNetOAuth.Messages {
/// A direct message sent from Service Provider to Consumer in response to
/// a Consumer's <see cref="RequestAccessTokenMessage"/> request.
/// </summary>
- internal class GrantAccessTokenMessage : MessageBase {
+ public class GrantAccessTokenMessage : MessageBase {
/// <summary>
/// Initializes a new instance of the <see cref="GrantAccessTokenMessage"/> class.
/// </summary>
@@ -23,7 +23,7 @@ namespace DotNetOAuth.Messages {
/// Gets or sets the Access Token assigned by the Service Provider.
/// </summary>
[MessagePart(Name = "oauth_token", IsRequired = true)]
- internal string AccessToken { get; set; }
+ public string AccessToken { get; set; }
/// <summary>
/// Gets or sets the Token Secret.
diff --git a/src/DotNetOAuth/ServiceProvider.cs b/src/DotNetOAuth/ServiceProvider.cs
index c43d46f..6e46ec4 100644
--- a/src/DotNetOAuth/ServiceProvider.cs
+++ b/src/DotNetOAuth/ServiceProvider.cs
@@ -42,7 +42,7 @@ namespace DotNetOAuth {
var signingElement = serviceDescription.CreateTamperProtectionElement();
signingElement.SignatureVerificationCallback = this.TokenSignatureVerificationCallback;
INonceStore store = new NonceMemoryStore(StandardExpirationBindingElement.DefaultMaximumMessageAge);
- this.Description = serviceDescription;
+ this.ServiceDescription = serviceDescription;
this.Channel = new OAuthChannel(signingElement, store, tokenManager, false);
this.TokenGenerator = new StandardTokenGenerator();
this.TokenManager = tokenManager;
@@ -51,7 +51,7 @@ namespace DotNetOAuth {
/// <summary>
/// Gets the description of this Service Provider.
/// </summary>
- public ServiceProviderDescription Description { get; private set; }
+ public ServiceProviderDescription ServiceDescription { get; private set; }
/// <summary>
/// Gets or sets the generator responsible for generating new tokens and secrets.