/** * Checks if this token has any of the scopes specified */ @CheckReturnValue public boolean validateScopes(String... scopes){ for (String s : scopes) { if (validateScope(s)) return true; } return false; }
/** * Checks if this token has any of the scopes specified */ @CheckReturnValue public boolean validateScopes(String... scopes){ for (String s : scopes) { if (validateScope(s)) return true; } return false; }
/** * Checks if this token has a scope that matches the given domain name and capability. * * @param host * Represents the endpoint. */ @CheckReturnValue public boolean validateCapability(URL host, Capability cap) { return validateScope(cap.to(host)) || validateScope(cap.toAll()); }
/** * Checks if this token has a scope that matches the given domain name and capability. * * @param host * Represents the endpoint. */ @CheckReturnValue public boolean validateCapability(URL host, Capability cap) { return validateScope(cap.to(host)) || validateScope(cap.toAll()); }
if(oauthToken != null){ for(String scope:scopes){ if(!oauthToken.validateScope(scope)){ throw new AuthException(401, String.format("Expected scope: %s not found on the token", scope));