introspected scopes are now space-separated, not arrays
parent
889ab830f8
commit
c98e34fc8f
|
@ -24,6 +24,8 @@ import java.util.Set;
|
||||||
import org.springframework.security.core.GrantedAuthority;
|
import org.springframework.security.core.GrantedAuthority;
|
||||||
import org.springframework.security.oauth2.provider.AuthorizationRequest;
|
import org.springframework.security.oauth2.provider.AuthorizationRequest;
|
||||||
|
|
||||||
|
import com.google.common.base.Splitter;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
import com.google.gson.JsonElement;
|
import com.google.gson.JsonElement;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
|
@ -36,9 +38,8 @@ public class AuthorizationRequestImpl implements AuthorizationRequest {
|
||||||
public AuthorizationRequestImpl(JsonObject token) {
|
public AuthorizationRequestImpl(JsonObject token) {
|
||||||
this.token = token;
|
this.token = token;
|
||||||
clientId = token.get("client_id").getAsString();
|
clientId = token.get("client_id").getAsString();
|
||||||
scopes = new HashSet<String>();
|
if (token.get("scope") != null) {
|
||||||
for (JsonElement e : token.get("scope").getAsJsonArray()) {
|
scopes = Sets.newHashSet(Splitter.on(" ").split(token.get("scope").getAsString()));
|
||||||
scopes.add(e.getAsString());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue