Skip to content

Commit 57208ac

Browse files
committed
added software statements to client API
1 parent d892573 commit 57208ac

File tree

6 files changed

+258
-12
lines changed

6 files changed

+258
-12
lines changed

openid-connect-server-webapp/src/main/webapp/WEB-INF/assertion-config.xml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,20 @@
3232
<!-- validate incoming tokens for JWT assertions -->
3333
<bean id="jwtAssertionValidator" class="org.mitre.jwt.assertion.impl.NullAssertionValidator" />
3434

35+
<!-- translate incoming assertions to token authorization objects -->
3536
<bean id="jwtAssertionTokenFactory" class="org.mitre.oauth2.assertion.impl.DirectCopyRequestFactory" />
3637

3738
<!-- validate client software statements for dynamic registration -->
38-
<bean id="clientAssertionValidator" class="org.mitre.jwt.assertion.impl.NullAssertionValidator" />
39+
<!-- <bean id="clientAssertionValidator" class="org.mitre.jwt.assertion.impl.NullAssertionValidator" /> -->
3940

4041
<!-- this class will pass assertions signed by the issuers and keys in the whitelist -->
41-
<!-- <bean id="clientAssertionValidator" class="org.mitre.jwt.assertion.impl.WhitelistedIssuerAssertionValidator"> -->
42-
<!-- <property name="whitelist"> -->
43-
<!-- <map> -->
44-
<!-- <entry key="http://artemesia.local" value="http://localhost:8080/openid-connect-server-webapp/jwk" /> -->
45-
<!-- </map> -->
46-
<!-- </property> -->
47-
<!-- </bean> -->
42+
<bean id="clientAssertionValidator" class="org.mitre.jwt.assertion.impl.WhitelistedIssuerAssertionValidator">
43+
<property name="whitelist">
44+
<map>
45+
<entry key="http://artemesia.local" value="http://localhost:8080/openid-connect-server-webapp/jwk" />
46+
</map>
47+
</property>
48+
</bean>
4849

4950

5051
</beans>

openid-connect-server-webapp/src/main/webapp/resources/js/client.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,7 @@ var ClientFormView = Backbone.View.extend({
936936
jwksUri: jwksUri,
937937
jwks: jwks,
938938
subjectType: subjectType,
939+
softwareStatement: $('#softwareStatement textarea').val(),
939940
tokenEndpointAuthMethod: tokenEndpointAuthMethod,
940941
responseTypes: responseTypes,
941942
sectorIdentifierUri: sectorIdentifierUri,

openid-connect-server-webapp/src/main/webapp/resources/js/locale/en/messages.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@
158158
"ps384": "RSASSA-PSS using SHA-384 and MGF1 with SHA-384",
159159
"ps512": "RSASSA-PSS using SHA-512 and MGF1 with SHA-512"
160160
},
161+
"software-statement": "Software Statement",
162+
"software-statement-placeholder": "eyj0...",
163+
"software-statement-help": "A software statement is issued by a trusted third party and locks certain elements of a client's registration",
161164
"subject-type": "Subject Type",
162165
"terms": "Terms of Service",
163166
"terms-help": "URL for the Terms of Service of this client, will be displayed to the user",

openid-connect-server-webapp/src/main/webapp/resources/template/client.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,16 @@ <h1 data-i18n="client.client-form.edit"></h1>
298298
<div class="controls">
299299
</div>
300300
</div>
301+
302+
<div class="control-group" id="softwareStatement">
303+
<label class="control-label" data-i18n="client.client-form.software-statement">Software Statement</label>
304+
<div class="controls">
305+
<textarea class="input-xlarge" placeholder="ejy0..." maxlength="4096"
306+
rows="3" data-i18n="[placeholder]client.client-form.software-statement-placeholder"><%-client.softwareStatement%></textarea>
307+
<p class="help-block" data-i18n="client.client-form.software-statement-help">A software statement is issued by a trusted third party and locks certain elements of a client's registration</p>
308+
</div>
309+
</div>
310+
301311
</div>
302312

303313
<div class="tab-pane" id="client-access-tab">

openid-connect-server/src/main/java/org/mitre/openid/connect/view/AbstractClientEntityView.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import com.nimbusds.jose.JWEAlgorithm;
4646
import com.nimbusds.jose.JWSAlgorithm;
4747
import com.nimbusds.jose.jwk.JWKSet;
48+
import com.nimbusds.jwt.JWT;
4849

4950
/**
5051
*
@@ -106,6 +107,17 @@ public JsonElement serialize(JWKSet src, Type typeOfSrc, JsonSerializationContex
106107
}
107108
}
108109
})
110+
.registerTypeAdapter(JWT.class, new JsonSerializer<JWT>() {
111+
@Override
112+
public JsonElement serialize(JWT src, Type typeOfSrc, JsonSerializationContext context) {
113+
if (src != null) {
114+
return new JsonPrimitive(src.serialize());
115+
} else {
116+
return null;
117+
}
118+
}
119+
120+
})
109121
.serializeNulls()
110122
.setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")
111123
.create();

0 commit comments

Comments
 (0)