added software ID and software version

pull/1161/merge
Justin Richer 2017-03-15 16:47:04 -04:00
parent 8406a89fd1
commit 22a4addfc0
6 changed files with 84 additions and 1 deletions

View File

@ -103,6 +103,8 @@ public class ClientDetailsEntity implements ClientDetails {
private String policyUri;
private String jwksUri; // URI pointer to keys
private JWKSet jwks; // public key stored by value
private String softwareId;
private String softwareVersion;
/** Fields from OIDC Client Registration Specification **/
private AppType applicationType; // application_type
@ -1049,4 +1051,36 @@ public class ClientDetailsEntity implements ClientDetails {
this.deviceCodeValiditySeconds = deviceCodeValiditySeconds;
}
/**
* @return the softwareId
*/
@Basic
@Column(name="software_id")
public String getSoftwareId() {
return softwareId;
}
/**
* @param softwareId the softwareId to set
*/
public void setSoftwareId(String softwareId) {
this.softwareId = softwareId;
}
/**
* @return the softwareVersion
*/
@Basic
@Column(name="software_version")
public String getSoftwareVersion() {
return softwareVersion;
}
/**
* @param softwareVersion the softwareVersion to set
*/
public void setSoftwareVersion(String softwareVersion) {
this.softwareVersion = softwareVersion;
}
}

View File

@ -862,6 +862,38 @@ public class RegisteredClient {
client.setDeviceCodeValiditySeconds(deviceCodeValiditySeconds);
}
/**
* @return
* @see org.mitre.oauth2.model.ClientDetailsEntity#getSoftwareId()
*/
public String getSoftwareId() {
return client.getSoftwareId();
}
/**
* @param softwareId
* @see org.mitre.oauth2.model.ClientDetailsEntity#setSoftwareId(java.lang.String)
*/
public void setSoftwareId(String softwareId) {
client.setSoftwareId(softwareId);
}
/**
* @return
* @see org.mitre.oauth2.model.ClientDetailsEntity#getSoftwareVersion()
*/
public String getSoftwareVersion() {
return client.getSoftwareVersion();
}
/**
* @param softwareVersion
* @see org.mitre.oauth2.model.ClientDetailsEntity#setSoftwareVersion(java.lang.String)
*/
public void setSoftwareVersion(String softwareVersion) {
client.setSoftwareVersion(softwareVersion);
}
}

View File

@ -17,6 +17,8 @@
package org.mitre.oauth2.model;
public interface RegisteredClientFields {
public String SOFTWARE_ID = "software_id";
public String SOFTWARE_VERSION = "software_version";
public String SOFTWARE_STATEMENT = "software_statement";
public String CLAIMS_REDIRECT_URIS = "claims_redirect_uris";
public String CLIENT_SECRET_EXPIRES_AT = "client_secret_expires_at";
@ -57,5 +59,4 @@ public interface RegisteredClientFields {
public String CLIENT_SECRET = "client_secret";
public String CLIENT_ID = "client_id";
public String CODE_CHALLENGE_METHOD = "code_challenge_method";
}

View File

@ -82,7 +82,9 @@ import static org.mitre.oauth2.model.RegisteredClientFields.RESPONSE_TYPES;
import static org.mitre.oauth2.model.RegisteredClientFields.SCOPE;
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.SOFTWARE_ID;
import static org.mitre.oauth2.model.RegisteredClientFields.SOFTWARE_STATEMENT;
import static org.mitre.oauth2.model.RegisteredClientFields.SOFTWARE_VERSION;
import static org.mitre.oauth2.model.RegisteredClientFields.SUBJECT_TYPE;
import static org.mitre.oauth2.model.RegisteredClientFields.TOKEN_ENDPOINT_AUTH_METHOD;
import static org.mitre.oauth2.model.RegisteredClientFields.TOKEN_ENDPOINT_AUTH_SIGNING_ALG;
@ -206,6 +208,9 @@ public class ClientDetailsEntityJsonProcessor {
c.setCodeChallengeMethod(getAsPkceAlgorithm(o, CODE_CHALLENGE_METHOD));
c.setSoftwareId(getAsString(o, SOFTWARE_ID));
c.setSoftwareVersion(getAsString(o, SOFTWARE_VERSION));
// note that this does not process or validate the software statement, that's handled in other components
String softwareStatement = getAsString(o, SOFTWARE_STATEMENT);
if (!Strings.isNullOrEmpty(softwareStatement)) {
@ -345,6 +350,9 @@ public class ClientDetailsEntityJsonProcessor {
o.addProperty(CODE_CHALLENGE_METHOD, c.getCodeChallengeMethod() != null ? c.getCodeChallengeMethod().getName() : null);
o.addProperty(SOFTWARE_ID, c.getSoftwareId());
o.addProperty(SOFTWARE_VERSION, c.getSoftwareVersion());
if (c.getSoftwareStatement() != null) {
o.addProperty(SOFTWARE_STATEMENT, c.getSoftwareStatement().serialize());
}

View File

@ -171,6 +171,8 @@ CREATE TABLE IF NOT EXISTS client_details (
clear_access_tokens_on_refresh BOOLEAN DEFAULT true NOT NULL,
software_statement VARCHAR(4096),
software_id VARCHAR(2048),
software_version VARCHAR(2048),
code_challenge_method VARCHAR(256),

View File

@ -160,9 +160,15 @@
"ps384": "RSASSA-PSS using SHA-384 and MGF1 with SHA-384",
"ps512": "RSASSA-PSS using SHA-512 and MGF1 with SHA-512"
},
"software-id": "Software ID",
"software-id-placeholder": "software ID...",
"software-id-help": "Identifier for the software in this client",
"software-statement": "Software Statement",
"software-statement-placeholder": "eyj0...",
"software-statement-help": "A software statement is issued by a trusted third party and locks certain elements of a client's registration",
"software-version": "Software Version",
"software-version-placeholder": "1.0...",
"software-version-help": "Version of the software in this client",
"subject-type": "Subject Type",
"terms": "Terms of Service",
"terms-help": "URL for the Terms of Service of this client, will be displayed to the user",