changed name of scope to match uma spec

pull/708/merge
Justin Richer 2015-02-27 20:46:48 -05:00
parent 351ce3995a
commit 0d96b6a28a
2 changed files with 3 additions and 3 deletions

View File

@ -36,7 +36,7 @@ public interface SystemScopeService {
public static final String ID_TOKEN_SCOPE = "id-token"; // ID tokens are generated using this scope
public static final String REGISTRATION_TOKEN_SCOPE = "registration-token"; // this scope manages dynamic client registrations
public static final String RESOURCE_TOKEN_SCOPE = "resource-token"; // this scope manages client-style protected resources
public static final String RESOURCE_SET_REGISTRATION_SCOPE = "resource_set_registration";
public static final String UMA_PROTECTION_SCOPE = "uma_protection";
public static final Set<SystemScope> reservedScopes =
Sets.newHashSet(

View File

@ -229,8 +229,8 @@ public class ResourceSetRegistrationEndpoint {
if (auth instanceof OAuth2Authentication) {
OAuth2Authentication oAuth2Authentication = (OAuth2Authentication) auth;
if (oAuth2Authentication.getOAuth2Request().getScope() == null
|| !oAuth2Authentication.getOAuth2Request().getScope().contains(SystemScopeService.RESOURCE_SET_REGISTRATION_SCOPE)) {
throw new InsufficientScopeException("Insufficient scope", ImmutableSet.of(SystemScopeService.RESOURCE_SET_REGISTRATION_SCOPE));
|| !oAuth2Authentication.getOAuth2Request().getScope().contains(SystemScopeService.UMA_PROTECTION_SCOPE)) {
throw new InsufficientScopeException("Insufficient scope", ImmutableSet.of(SystemScopeService.UMA_PROTECTION_SCOPE));
}
}
}