Skip to content

Commit f62e618

Browse files
committed
Update dependency / html form
1 parent c15a89d commit f62e618

File tree

3 files changed

+40
-14
lines changed

3 files changed

+40
-14
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1414

1515
<authlete.java.common.version>3.68</authlete.java.common.version>
16-
<authlete.java.jaxrs.version>2.59</authlete.java.jaxrs.version>
16+
<authlete.java.jaxrs.version>2.61</authlete.java.jaxrs.version>
1717
<javax.servlet-api.version>3.0.1</javax.servlet-api.version>
1818
<jersey.version>2.30.1</jersey.version>
1919
<jetty.version>9.4.27.v20200227</jetty.version>

src/main/java/com/authlete/jaxrs/server/api/CredentialOfferPageModel.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,8 @@ public class CredentialOfferPageModel extends AuthorizationPageModel
5555
private static final String DEFAULT_CREDENTIALS = "[\n" +
5656
" {\n" +
5757
" \"format\": \"vc+sd-jwt\",\n" +
58-
" \"type\": \"IdentityCredential\",\n" +
5958
" \"credential_definition\": {\n" +
60-
" \"given_name\": {},\n" +
61-
" \"family_name\": {},\n" +
62-
" \"birthdate\": {}\n" +
59+
" \"type\": \"IdentityCredential\"\n" +
6360
" }\n" +
6461
" }\n" +
6562
"]";

src/main/webapp/WEB-INF/template/credential-offer.jsp

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,34 @@
3232
<!-- <% /* //-->
3333
<link rel="stylesheet" href="../../css/authorization.css">
3434
<!-- */ %> //-->
35+
36+
<script>
37+
function cascadeDependency(src, dst) {
38+
const srcElem = document.getElementById(src);
39+
const dstElem = document.getElementById(dst);
40+
41+
dstElem.disabled = !srcElem.checked
42+
}
43+
44+
function cascadeAuthorizationCodeGrantIncluded() {
45+
cascadeDependency("authorizationCodeGrantIncluded", "issuerStateIncluded");
46+
}
47+
48+
function cascadePreAuthorizedCodeGrantIncluded() {
49+
cascadeDependency("preAuthorizedCodeGrantIncluded", "userPinRequired");
50+
cascadeDependency("preAuthorizedCodeGrantIncluded", "userPinLength");
51+
}
52+
53+
window.onload = function() {
54+
cascadeAuthorizationCodeGrantIncluded();
55+
cascadePreAuthorizedCodeGrantIncluded();
56+
57+
document.getElementById("authorizationCodeGrantIncluded")
58+
.addEventListener('click', cascadeAuthorizationCodeGrantIncluded);
59+
document.getElementById("preAuthorizedCodeGrantIncluded")
60+
.addEventListener('click', cascadePreAuthorizedCodeGrantIncluded);
61+
};
62+
</script>
3563
</head>
3664
<body class="font-default">
3765
<div id="page_title">Credential Offer</div>
@@ -40,10 +68,8 @@
4068
<form id="credential-offer-form" action="/api/offer/issue" method="POST">
4169
<c:if test="${model.user == null}">
4270
<div class="indent">
43-
<h4 id="authorization">Authorization</h4>
71+
<h4 id="authorization">Login</h4>
4472
<div class="indent">
45-
<p>Do you grant authorization to the application?</p>
46-
4773
<div id="login-fields" class="indent">
4874
<div id="login-prompt">Input Login ID and Password.</div>
4975
<input type="text" id="loginId" name="loginId" placeholder="Login ID"
@@ -66,16 +92,17 @@
6692
<td><label for="authorizationCodeGrantIncluded">Authorization code grant included</label></td>
6793
<td>
6894
<input type="checkbox" id="authorizationCodeGrantIncluded" name="authorizationCodeGrantIncluded"
69-
<c:if test="${model.authorizationCodeGrantIncluded}">checked</c:if> class="font-default">
95+
<c:if test="${model.authorizationCodeGrantIncluded}">checked</c:if> class="font-default">
7096
</td>
7197
</tr>
7298
<tr>
73-
<td><label for="issuerStateIncluded">Issuer state included</label></td>
99+
<td><div class="indent"><label for="issuerStateIncluded">Issuer state included</label></div></td>
74100
<td>
75101
<input type="checkbox" id="issuerStateIncluded" name="issuerStateIncluded"
76102
<c:if test="${model.issuerStateIncluded}">checked</c:if> class="font-default">
77103
</td>
78104
</tr>
105+
<tr></tr>
79106
<tr>
80107
<td><label for="preAuthorizedCodeGrantIncluded">Pre-authorized code grant included</label></td>
81108
<td>
@@ -84,18 +111,20 @@
84111
</td>
85112
</tr>
86113
<tr>
87-
<td><label for="userPinRequired">User pin required</label></td>
114+
<td><div class="indent"><label for="userPinRequired">User pin required</label></div></td>
88115
<td>
89116
<input type="checkbox" id="userPinRequired" name="userPinRequired"
90117
<c:if test="${model.userPinRequired}">checked</c:if> class="font-default">
91118
</td>
92119
</tr>
93120
<tr>
94-
<td><label for="userPinRequired">User pin length</label></td>
121+
<td><div class="indent"><label for="userPinLength">User pin length</label></div></td>
95122
<td>
96-
<input type="number" id="userPinLength" name="userPinLength" value="${model.userPinLength}" class="font-default">
123+
<input type="number" id="userPinLength" name="userPinLength" value="${model.userPinLength}"
124+
min="0" max="8" class="font-default">
97125
</td>
98126
</tr>
127+
<tr></tr>
99128
<tr>
100129
<td><label for="credentials">Credentials</label></td>
101130
<td>
@@ -106,7 +135,7 @@
106135
<td><label for="credentialOfferEndpoint">Credential offer endpoint</label></td>
107136
<td>
108137
<input type="text" id="credentialOfferEndpoint" name="credentialOfferEndpoint"
109-
value="${model.credentialOfferEndpoint}" class="font-default">
138+
value="${model.credentialOfferEndpoint}" size="40" class="font-default">
110139
</td>
111140
</tr>
112141
</table>

0 commit comments

Comments
 (0)