summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMicrosoft <aspnet@microsoft.com>2012-03-01 12:26:24 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2012-03-01 19:38:31 -0800
commit2137afe38f2c403892d479bf1761d40f444ff141 (patch)
tree07a9ba5991e2bd09b6cdf4a3e53dfd295c017a75 /src
parent8d4a91990809ea9f83fba560e03fe45124637ba3 (diff)
downloadDotNetOpenAuth-2137afe38f2c403892d479bf1761d40f444ff141.zip
DotNetOpenAuth-2137afe38f2c403892d479bf1761d40f444ff141.tar.gz
DotNetOpenAuth-2137afe38f2c403892d479bf1761d40f444ff141.tar.bz2
Add access token to the extraData dictionary when authentication is successful.
Diffstat (limited to 'src')
-rw-r--r--src/DotNetOpenAuth.AspNet/Clients/OAuth/OAuthClient.cs9
-rw-r--r--src/DotNetOpenAuth.AspNet/Clients/OAuth2/OAuth2Client.cs3
2 files changed, 11 insertions, 1 deletions
diff --git a/src/DotNetOpenAuth.AspNet/Clients/OAuth/OAuthClient.cs b/src/DotNetOpenAuth.AspNet/Clients/OAuth/OAuthClient.cs
index 0bc8ed9..5e57f6e 100644
--- a/src/DotNetOpenAuth.AspNet/Clients/OAuth/OAuthClient.cs
+++ b/src/DotNetOpenAuth.AspNet/Clients/OAuth/OAuthClient.cs
@@ -89,7 +89,14 @@
return AuthenticationResult.Failed;
}
- return VerifyAuthenticationCore(response);
+ // add the access token to the user data dictionary just in case page developers want to use it
+ AuthenticationResult result = VerifyAuthenticationCore(response);
+ if (result.IsSuccessful && result.ExtraData != null)
+ {
+ result.ExtraData["accesstoken"] = response.AccessToken;
+ }
+
+ return result;
}
/// <summary>
diff --git a/src/DotNetOpenAuth.AspNet/Clients/OAuth2/OAuth2Client.cs b/src/DotNetOpenAuth.AspNet/Clients/OAuth2/OAuth2Client.cs
index 276f5f4..ff50521 100644
--- a/src/DotNetOpenAuth.AspNet/Clients/OAuth2/OAuth2Client.cs
+++ b/src/DotNetOpenAuth.AspNet/Clients/OAuth2/OAuth2Client.cs
@@ -83,6 +83,9 @@
name = id;
}
+ // add the access token to the user data dictionary just in case page developers want to use it
+ userData["accesstoken"] = accessToken;
+
return new AuthenticationResult(
isSuccessful: true,
provider: ProviderName,