1 package org.springframework.security.oauth2.common.exceptions;
2
3 import java.util.Set;
4
5 import org.springframework.security.oauth2.common.util.OAuth2Utils;
6
7
8
9
10
11
12
13
14
15 @SuppressWarnings("serial")
16 public class InvalidScopeException extends OAuth2Exception {
17
18 public InvalidScopeException(String msg, Set<String> validScope) {
19 this(msg);
20 addAdditionalInformation("scope", OAuth2Utils.formatParameterList(validScope));
21 }
22
23 public InvalidScopeException(String msg) {
24 super(msg);
25 }
26
27 @Override
28 public String getOAuth2ErrorCode() {
29 return "invalid_scope";
30 }
31
32 }