Skip to content

Commit

Permalink
Client scope now supported
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Jett committed May 18, 2012
1 parent 9b8aa14 commit 1f0df8d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
13 changes: 7 additions & 6 deletions openid-connect-server/src/main/webapp/resources/js/app.js
Expand Up @@ -29,16 +29,16 @@
minlength:3,
maxlength:200
},
registeredRedirectUri: {
custom: 'validateURI'
},
accessTokenTimeout: {
required: true,
type:"number"
},
refreshTokenTimeout: {
required: true,
type:"number"
},
registeredRedirectUri: {
custom: 'validateURI'
}
},

Expand All @@ -61,7 +61,7 @@
clientName:"",
registeredRedirectUri:[""],
authorizedGrantTypes:[],
scope:[],
scope:[""],
authorities:[],
clientDescription:"",
clientId:null,
Expand Down Expand Up @@ -187,11 +187,12 @@

this.model.set({
clientName:$('#clientName input').val(),
registeredRedirectUri:[$('#registeredRedirectUri input').val()],
registeredRedirectUri:$.trim($('#registeredRedirectUri textarea').val()).replace(/ /g,'').split("\n"),
clientDescription:$('#clientDescription textarea').val(),
allowRefresh:$('#allowRefresh').is(':checked'),
accessTokenTimeout: $('#accessTokenTimeout input').val(),
refreshTokenTimeout: $('#refreshTokenTimeout input').val()
refreshTokenTimeout: $('#refreshTokenTimeout input').val(),
scope:$.map($('#scope textarea').val().replace(/,$/,'').replace(/\s/g,' ').split(","), $.trim)
});

this.model.save(this.model, {
Expand Down
Expand Up @@ -4,7 +4,13 @@
<%=clientName%>
</td>
<td>
<%=registeredRedirectUri[0]%>
<ul>
<% for (var i in registeredRedirectUri) { %>
<li>
<%=registeredRedirectUri[i]%>
</li>
<% } %>
</ul>
</td>
<td>
<ul>
Expand Down Expand Up @@ -52,7 +58,7 @@
<thead>
<tr>
<th>Name</th>
<th>Redirect URL</th>
<th>Redirect URI(s)</th>
<th>Grant Types</th>
<th>Scope</th>
<th>Authority</th>
Expand Down Expand Up @@ -88,18 +94,19 @@ <h1><%=(clientId == null ? 'New' : 'Edit')%> Client</h1>
<div class="span6">
<span class="control-group" id="clientName">
<label>Client name</label>
<input value="<%=clientName%>" type="text" class="" placeholder="Type something"> <span class="help-inline">Associated help text!</span>
<input value="<%=clientName%>" type="text" class="" placeholder="Type something"> <span class="help-inline">This must be more than three characters and can only be alpha-numeric </span>
</span>
<span class="control-group" id="registeredRedirectUri">
<label>Redirect URL</label>
<input type="text" class="" value="<%=registeredRedirectUri[0]%>" placeholder="http://"><span class="help-inline">Associated help text!</span>
<label>Redirect URI(s)</label>
<textarea class="input-xlarge" placeholder="http://"
rows="3"><% for (var i in registeredRedirectUri) { %><%=registeredRedirectUri[i]+"\n"%><% } %></textarea> <span class="help-inline">You may enter multiple URLs separated by a new lines</span>
</span>
</div>
<div class="span6">
<span class="control-group" id="clientDescription">
<label>Description</label>
<textarea class="input-xlarge" placeholder="Type a description"
rows="3"><%=clientDescription%></textarea> <span class="help-inline">Associated help text!</span>
rows="3"><%=clientDescription%></textarea> <span class="help-inline">This must be more than three characters and can only be alpha-numeric</span>
</span>
</div>
</div>
Expand Down Expand Up @@ -198,12 +205,12 @@ <h1><%=(clientId == null ? 'New' : 'Edit')%> Client</h1>
</div>


<div class="span12 control-group">
<div id="scope" class="span12 control-group">
<label for="textarea2">Scope</label>

<div class="input">
<textarea rows="3" class="xlarge span10" placeholder="email,first name, last name"
id="textarea2" name="textarea2"></textarea>
id="textarea2" name="textarea2"><% for (var i in scope) { %><%=scope[i]+","%><% } %></textarea>
<span class="help-block">
Please enter scopes separated by commas
</span>
Expand Down

0 comments on commit 1f0df8d

Please sign in to comment.