Skip to content

Commit

Permalink
Copy refresh token value correctly in JwtAccessTokenConverter
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Syer committed May 16, 2014
1 parent 93e849f commit 51eb6d8
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ public OAuth2AccessToken enhance(OAuth2AccessToken accessToken, OAuth2Authentica
OAuth2RefreshToken refreshToken = result.getRefreshToken();
if (refreshToken != null) {
DefaultOAuth2AccessToken encodedRefreshToken = new DefaultOAuth2AccessToken(accessToken);
encodedRefreshToken.setValue(refreshToken.getValue());
Map<String, Object> refreshTokenInfo = new LinkedHashMap<String, Object>(accessToken.getAdditionalInformation());
refreshTokenInfo.put(TOKEN_ID, encodedRefreshToken.getValue());
encodedRefreshToken.setAdditionalInformation(refreshTokenInfo);
DefaultOAuth2RefreshToken token = new DefaultOAuth2RefreshToken(encode(encodedRefreshToken, authentication));
if (refreshToken instanceof ExpiringOAuth2RefreshToken) {
Date expiration = ((ExpiringOAuth2RefreshToken) refreshToken).getExpiration();
Expand Down

0 comments on commit 51eb6d8

Please sign in to comment.