diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2012-04-25 06:21:30 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2012-04-25 06:21:30 -0700 |
commit | d10db64d32f10c9514918541542af3bbf5889fca (patch) | |
tree | 34a338c26072e142c50e59e119a8b10551ed1524 /src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/TokenCodeSerializationBindingElement.cs | |
parent | bf30c08cce5b18f6dc1679be8e4e610819efa9a7 (diff) | |
download | DotNetOpenAuth-d10db64d32f10c9514918541542af3bbf5889fca.zip DotNetOpenAuth-d10db64d32f10c9514918541542af3bbf5889fca.tar.gz DotNetOpenAuth-d10db64d32f10c9514918541542af3bbf5889fca.tar.bz2 |
Authorization Server hosts now instantiate their own AccessTokens rather than just parameters.
AccessTokens are now serialized via a virtual method on that instance.
Fixes #38, I think.
Diffstat (limited to 'src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/TokenCodeSerializationBindingElement.cs')
-rw-r--r-- | src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/TokenCodeSerializationBindingElement.cs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/TokenCodeSerializationBindingElement.cs b/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/TokenCodeSerializationBindingElement.cs index 41bc609..494a10b 100644 --- a/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/TokenCodeSerializationBindingElement.cs +++ b/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/TokenCodeSerializationBindingElement.cs @@ -71,10 +71,7 @@ namespace DotNetOpenAuth.OAuth2.ChannelElements { var accessTokenResponse = message as IAccessTokenIssuingResponse; if (accessTokenResponse != null && accessTokenResponse.AuthorizationDescription != null) { ErrorUtilities.VerifyInternal(request != null, "We should always have a direct request message for this case."); - var accessTokenFormatter = AccessToken.CreateFormatter( - request.AccessTokenCreationParameters.AccessTokenSigningKey, - request.AccessTokenCreationParameters.ResourceServerEncryptionKey); - accessTokenResponse.AccessToken = accessTokenFormatter.Serialize(accessTokenResponse.AuthorizationDescription); + accessTokenResponse.AccessToken = accessTokenResponse.AuthorizationDescription.Serialize(); } return null; @@ -105,14 +102,16 @@ namespace DotNetOpenAuth.OAuth2.ChannelElements { var authCodeCarrier = message as IAuthorizationCodeCarryingRequest; if (authCodeCarrier != null) { var authorizationCodeFormatter = AuthorizationCode.CreateFormatter(this.AuthorizationServer); - var authorizationCode = authorizationCodeFormatter.Deserialize(message, authCodeCarrier.Code, Protocol.code); + var authorizationCode = new AuthorizationCode(); + authorizationCodeFormatter.Deserialize(authorizationCode, message, authCodeCarrier.Code, Protocol.code); authCodeCarrier.AuthorizationDescription = authorizationCode; } var refreshTokenCarrier = message as IRefreshTokenCarryingRequest; if (refreshTokenCarrier != null) { var refreshTokenFormatter = RefreshToken.CreateFormatter(this.AuthorizationServer.CryptoKeyStore); - var refreshToken = refreshTokenFormatter.Deserialize(message, refreshTokenCarrier.RefreshToken, Protocol.refresh_token); + var refreshToken = new RefreshToken(); + refreshTokenFormatter.Deserialize(refreshToken, message, refreshTokenCarrier.RefreshToken, Protocol.refresh_token); refreshTokenCarrier.AuthorizationDescription = refreshToken; } |