From 544e3d7b4328b62d9402afa70233c40ec393efb9 Mon Sep 17 00:00:00 2001 From: Justin Richer Date: Fri, 7 Dec 2012 10:06:10 -0500 Subject: [PATCH] added copy constructors because Dave likes to use unmodifiable sets for no apparent reason --- .../service/impl/DefaultOAuth2ProviderTokenService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/service/impl/DefaultOAuth2ProviderTokenService.java b/openid-connect-server/src/main/java/org/mitre/oauth2/service/impl/DefaultOAuth2ProviderTokenService.java index f0a1fee31..5b0cf752f 100644 --- a/openid-connect-server/src/main/java/org/mitre/oauth2/service/impl/DefaultOAuth2ProviderTokenService.java +++ b/openid-connect-server/src/main/java/org/mitre/oauth2/service/impl/DefaultOAuth2ProviderTokenService.java @@ -19,6 +19,7 @@ package org.mitre.oauth2.service.impl; import java.util.Date; +import java.util.HashSet; import java.util.List; import java.util.Set; @@ -171,9 +172,9 @@ public class DefaultOAuth2ProviderTokenService implements OAuth2TokenEntityServi OAuth2AccessTokenEntity token = new OAuth2AccessTokenEntity(); // get the stored scopes from the authentication holder's authorization request; these are the scopes associated with the refresh token - Set refreshScopes = refreshToken.getAuthenticationHolder().getAuthentication().getAuthorizationRequest().getScope(); + Set refreshScopes = new HashSet(refreshToken.getAuthenticationHolder().getAuthentication().getAuthorizationRequest().getScope()); - Set scope = authRequest.getScope(); + Set scope = new HashSet(authRequest.getScope()); if (scope != null && !scope.isEmpty()) { // ensure a proper subset of scopes if (refreshScopes != null && refreshScopes.containsAll(scope)) {