Browse Source

introspected scopes are now space-separated, not arrays

pull/650/head
Justin Richer 11 years ago
parent
commit
c98e34fc8f
  1. 7
      openid-connect-client/src/main/java/org/mitre/oauth2/introspectingfilter/AuthorizationRequestImpl.java

7
openid-connect-client/src/main/java/org/mitre/oauth2/introspectingfilter/AuthorizationRequestImpl.java

@ -24,6 +24,8 @@ import java.util.Set;
import org.springframework.security.core.GrantedAuthority;
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.JsonObject;
@ -36,9 +38,8 @@ public class AuthorizationRequestImpl implements AuthorizationRequest {
public AuthorizationRequestImpl(JsonObject token) {
this.token = token;
clientId = token.get("client_id").getAsString();
scopes = new HashSet<String>();
for (JsonElement e : token.get("scope").getAsJsonArray()) {
scopes.add(e.getAsString());
if (token.get("scope") != null) {
scopes = Sets.newHashSet(Splitter.on(" ").split(token.get("scope").getAsString()));
}
}

Loading…
Cancel
Save