Browse Source

added claims redirect URIs to dynamic registration model

pull/1016/head
Justin Richer 9 years ago
parent
commit
c386f0d7c1
  1. 16
      openid-connect-common/src/main/java/org/mitre/oauth2/model/RegisteredClient.java
  2. 1
      openid-connect-common/src/main/java/org/mitre/oauth2/model/RegisteredClientFields.java
  3. 43
      openid-connect-common/src/main/java/org/mitre/openid/connect/ClientDetailsEntityJsonProcessor.java

16
openid-connect-common/src/main/java/org/mitre/oauth2/model/RegisteredClient.java

@ -783,6 +783,22 @@ public class RegisteredClient {
this.clientIdIssuedAt = issuedAt;
}
/**
* @return
* @see org.mitre.oauth2.model.ClientDetailsEntity#getClaimsRedirectUris()
*/
public Set<String> getClaimsRedirectUris() {
return client.getClaimsRedirectUris();
}
/**
* @param claimsRedirectUris
* @see org.mitre.oauth2.model.ClientDetailsEntity#setClaimsRedirectUris(java.util.Set)
*/
public void setClaimsRedirectUris(Set<String> claimsRedirectUris) {
client.setClaimsRedirectUris(claimsRedirectUris);
}
/**
* @return the src
*/

1
openid-connect-common/src/main/java/org/mitre/oauth2/model/RegisteredClientFields.java

@ -17,6 +17,7 @@
package org.mitre.oauth2.model;
public interface RegisteredClientFields {
public String CLAIMS_REDIRECT_URIS = "claims_redirect_uris";
public String CLIENT_SECRET_EXPIRES_AT = "client_secret_expires_at";
public String CLIENT_ID_ISSUED_AT = "client_id_issued_at";
public String REGISTRATION_CLIENT_URI = "registration_client_uri";

43
openid-connect-common/src/main/java/org/mitre/openid/connect/ClientDetailsEntityJsonProcessor.java

@ -20,24 +20,6 @@
package org.mitre.openid.connect;
import java.text.ParseException;
import org.mitre.oauth2.model.ClientDetailsEntity;
import org.mitre.oauth2.model.ClientDetailsEntity.AppType;
import org.mitre.oauth2.model.ClientDetailsEntity.AuthMethod;
import org.mitre.oauth2.model.ClientDetailsEntity.SubjectType;
import org.mitre.oauth2.model.RegisteredClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.Joiner;
import com.google.common.base.Splitter;
import com.google.common.collect.Sets;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.nimbusds.jose.jwk.JWKSet;
import static org.mitre.oauth2.model.RegisteredClientFields.APPLICATION_TYPE;
import static org.mitre.oauth2.model.RegisteredClientFields.CLIENT_ID;
import static org.mitre.oauth2.model.RegisteredClientFields.CLIENT_ID_ISSUED_AT;
@ -65,7 +47,7 @@ import static org.mitre.oauth2.model.RegisteredClientFields.REQUEST_OBJECT_SIGNI
import static org.mitre.oauth2.model.RegisteredClientFields.REQUEST_URIS;
import static org.mitre.oauth2.model.RegisteredClientFields.REQUIRE_AUTH_TIME;
import static org.mitre.oauth2.model.RegisteredClientFields.RESPONSE_TYPES;
import static org.mitre.oauth2.model.RegisteredClientFields.SCOPE;
import static org.mitre.oauth2.model.RegisteredClientFields.*;
import static org.mitre.oauth2.model.RegisteredClientFields.SCOPE_SEPARATOR;
import static org.mitre.oauth2.model.RegisteredClientFields.SECTOR_IDENTIFIER_URI;
import static org.mitre.oauth2.model.RegisteredClientFields.SUBJECT_TYPE;
@ -83,6 +65,24 @@ import static org.mitre.util.JsonUtils.getAsJwsAlgorithm;
import static org.mitre.util.JsonUtils.getAsString;
import static org.mitre.util.JsonUtils.getAsStringSet;
import java.text.ParseException;
import org.mitre.oauth2.model.ClientDetailsEntity;
import org.mitre.oauth2.model.ClientDetailsEntity.AppType;
import org.mitre.oauth2.model.ClientDetailsEntity.AuthMethod;
import org.mitre.oauth2.model.ClientDetailsEntity.SubjectType;
import org.mitre.oauth2.model.RegisteredClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.Joiner;
import com.google.common.base.Splitter;
import com.google.common.collect.Sets;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.nimbusds.jose.jwk.JWKSet;
/**
* Utility class to handle the parsing and serialization of ClientDetails objects.
*
@ -193,6 +193,8 @@ public class ClientDetailsEntityJsonProcessor {
c.setPostLogoutRedirectUris(getAsStringSet(o, POST_LOGOUT_REDIRECT_URIS));
c.setRequestUris(getAsStringSet(o, REQUEST_URIS));
c.setClaimsRedirectUris(getAsStringSet(o, CLAIMS_REDIRECT_URIS));
return c;
} else {
return null;
@ -313,6 +315,9 @@ public class ClientDetailsEntityJsonProcessor {
o.addProperty(INITIATE_LOGIN_URI, c.getInitiateLoginUri());
o.add(POST_LOGOUT_REDIRECT_URIS, getAsArray(c.getPostLogoutRedirectUris()));
o.add(REQUEST_URIS, getAsArray(c.getRequestUris()));
o.add(CLAIMS_REDIRECT_URIS, getAsArray(c.getClaimsRedirectUris()));
return o;
}

Loading…
Cancel
Save