diff options
author | Microsoft <aspnet@microsoft.com> | 2012-03-01 12:26:24 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2012-03-01 19:38:31 -0800 |
commit | 2137afe38f2c403892d479bf1761d40f444ff141 (patch) | |
tree | 07a9ba5991e2bd09b6cdf4a3e53dfd295c017a75 /src | |
parent | 8d4a91990809ea9f83fba560e03fe45124637ba3 (diff) | |
download | DotNetOpenAuth-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.cs | 9 | ||||
-rw-r--r-- | src/DotNetOpenAuth.AspNet/Clients/OAuth2/OAuth2Client.cs | 3 |
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, |