Skip to content

Commit 793740c

Browse files
committed
added warnings for empty scopes and empty redirect URI lists
1 parent db052f1 commit 793740c

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,19 @@
5151
</td>
5252

5353
<td>
54-
<% if (client.redirectUris) { %>
54+
<% if (_.isEmpty(client.redirectUris)) {
55+
if (_.contains(client.grantTypes, 'authorization_code') ||
56+
_.contains(client.grantTypes, 'implicit')) {
57+
%>
58+
<div><span class="badge badge-important"><i class="icon-warning-sign icon-white"></i> NO REDIRECT URI</span></div>
59+
<% }
60+
} else { %>
5561
<div><span class="muted">
5662
<% for (var i in client.redirectUris) {
5763
var uri = $.url(client.redirectUris[i]);
58-
if (uri.attr('protocol') == 'http' && uri.attr('host') != 'localhost') {
64+
if (!uri.attr('protocol')) {
65+
%><b class="text-error" title="unknown protocol scheme">?</b><%
66+
} else if (uri.attr('protocol') == 'http' && uri.attr('host') != 'localhost') {
5967
%><b class="text-error"><%- uri.attr('protocol') %></b>://<%
6068
} else if (uri.attr('protocol') != 'https' && uri.attr('protocol') != 'http') {
6169
%><span class="text-warning"><%- uri.attr('protocol') %></span>://<%

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,13 @@ <h3 id="iconSelectorLabel">Select an Icon</h3>
191191
<script type="text/html" id="tmpl-scope-list">
192192

193193
<%
194+
if (_.isEmpty(scopes)) {
195+
%>
196+
<span class="badge badge-important"><i class="icon-warning-sign icon-white"></i> NO SCOPES</span>
197+
<%
198+
199+
} else {
200+
194201
_.each(scopes, function(s) {
195202
var ss = systemScopes.getByValue(s);
196203

@@ -215,6 +222,8 @@ <h3 id="iconSelectorLabel">Select an Icon</h3>
215222
}
216223

217224
});
225+
226+
}
218227
%>
219228

220229
</script>

0 commit comments

Comments
 (0)