grant types rename
parent
33c488d9ae
commit
ac44020305
|
@ -21,7 +21,7 @@ var ClientModel = Backbone.Model.extend({
|
||||||
clientName:"",
|
clientName:"",
|
||||||
clientSecret:"",
|
clientSecret:"",
|
||||||
redirectUris:[],
|
redirectUris:[],
|
||||||
authorizedGrantTypes:["authorization_code"],
|
grantTypes:["authorization_code"],
|
||||||
scope:[],
|
scope:[],
|
||||||
authorities:[],
|
authorities:[],
|
||||||
clientDescription:"",
|
clientDescription:"",
|
||||||
|
@ -289,7 +289,7 @@ var ClientFormView = Backbone.View.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
// maps from a form-friendly name to the real grant parameter name
|
// maps from a form-friendly name to the real grant parameter name
|
||||||
authorizedGrantMap:{
|
grantMap:{
|
||||||
"authorization_code": "authorization_code",
|
"authorization_code": "authorization_code",
|
||||||
"password": "password",
|
"password": "password",
|
||||||
"implicit": "implicit",
|
"implicit": "implicit",
|
||||||
|
@ -306,10 +306,10 @@ var ClientFormView = Backbone.View.extend({
|
||||||
var scopes = this.scopeCollection.pluck("item");
|
var scopes = this.scopeCollection.pluck("item");
|
||||||
|
|
||||||
// build the grant type object
|
// build the grant type object
|
||||||
var authorizedGrantTypes = [];
|
var grantTypes = [];
|
||||||
$.each(this.authorizedGrantMap, function(index,type) {
|
$.each(this.grantMap, function(index,type) {
|
||||||
if ($('#authorizedGrantTypes-' + index).is(':checked')) {
|
if ($('#grantTypes-' + index).is(':checked')) {
|
||||||
authorizedGrantTypes.push(type);
|
grantTypes.push(type);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -318,10 +318,11 @@ var ClientFormView = Backbone.View.extend({
|
||||||
var clientSecret = null;
|
var clientSecret = null;
|
||||||
|
|
||||||
if (requireClientSecret && !generateClientSecret) {
|
if (requireClientSecret && !generateClientSecret) {
|
||||||
// if it's required but we're not generating it, send the value
|
// if it's required but we're not generating it, send the value to preserve it
|
||||||
clientSecret = $('#clientSecret input').val();
|
clientSecret = $('#clientSecret input').val();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: validate these as integers
|
||||||
var accessTokenValiditySeconds = null;
|
var accessTokenValiditySeconds = null;
|
||||||
if (!$('disableAccessTokenTimeout').is(':checked')) {
|
if (!$('disableAccessTokenTimeout').is(':checked')) {
|
||||||
accessTokenValiditySeconds = this.getFormTokenValue($('#accessTokenValiditySeconds input[type=text]').val());
|
accessTokenValiditySeconds = this.getFormTokenValue($('#accessTokenValiditySeconds input[type=text]').val());
|
||||||
|
@ -356,7 +357,7 @@ var ClientFormView = Backbone.View.extend({
|
||||||
redirectUris: this.redirectUrisCollection.pluck("item"),
|
redirectUris: this.redirectUrisCollection.pluck("item"),
|
||||||
clientDescription:$('#clientDescription textarea').val(),
|
clientDescription:$('#clientDescription textarea').val(),
|
||||||
logoUri:$('#logoUri input').val(),
|
logoUri:$('#logoUri input').val(),
|
||||||
authorizedGrantTypes: authorizedGrantTypes,
|
grantTypes: grantTypes,
|
||||||
accessTokenValiditySeconds: accessTokenValiditySeconds,
|
accessTokenValiditySeconds: accessTokenValiditySeconds,
|
||||||
refreshTokenValiditySeconds: refreshTokenValiditySeconds,
|
refreshTokenValiditySeconds: refreshTokenValiditySeconds,
|
||||||
idTokenValiditySeconds: idTokenValiditySeconds,
|
idTokenValiditySeconds: idTokenValiditySeconds,
|
||||||
|
|
|
@ -138,38 +138,38 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="control-group" id="authorizedGrantTypes">
|
<div class="control-group" id="grantTypes">
|
||||||
<label class="control-label">Authorized Grant Types</label>
|
<label class="control-label">Grant Types</label>
|
||||||
|
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
|
|
||||||
<label class="checkbox">
|
<label class="checkbox">
|
||||||
<input id="authorizedGrantTypes-authorization_code" type="checkbox"
|
<input id="grantTypes-authorization_code" type="checkbox"
|
||||||
<%=($.inArray("authorization_code", authorizedGrantTypes) > -1 ? 'checked' : '')%>>
|
<%=($.inArray("authorization_code", grantTypes) > -1 ? 'checked' : '')%>>
|
||||||
authorization code
|
authorization code
|
||||||
</label>
|
</label>
|
||||||
<label class="checkbox">
|
<label class="checkbox">
|
||||||
<input id="authorizedGrantTypes-client_credentials" type="checkbox"
|
<input id="grantTypes-client_credentials" type="checkbox"
|
||||||
<%=($.inArray("client_credentials", authorizedGrantTypes) > -1 ? 'checked' : '')%>> client
|
<%=($.inArray("client_credentials", grantTypes) > -1 ? 'checked' : '')%>> client
|
||||||
credentials
|
credentials
|
||||||
</label>
|
</label>
|
||||||
<label class="checkbox">
|
<label class="checkbox">
|
||||||
<input id="authorizedGrantTypes-password" type="checkbox" <%=($.inArray("password",
|
<input id="grantTypes-password" type="checkbox" <%=($.inArray("password",
|
||||||
authorizedGrantTypes) > -1 ? 'checked' : '')%>> password
|
grantTypes) > -1 ? 'checked' : '')%>> password
|
||||||
</label>
|
</label>
|
||||||
<label class="checkbox">
|
<label class="checkbox">
|
||||||
<input id="authorizedGrantTypes-implicit" type="checkbox" <%=($.inArray("implicit",
|
<input id="grantTypes-implicit" type="checkbox" <%=($.inArray("implicit",
|
||||||
authorizedGrantTypes) > -1 ? 'checked' : '')%>> implicit
|
grantTypes) > -1 ? 'checked' : '')%>> implicit
|
||||||
</label>
|
</label>
|
||||||
<!--
|
<!--
|
||||||
<label class="checkbox">
|
<label class="checkbox">
|
||||||
<input id="authorizedGrantTypes-refresh_token" type="checkbox" <%=($.inArray("refresh_token",
|
<input id="grantTypes-refresh_token" type="checkbox" <%=($.inArray("refresh_token",
|
||||||
authorizedGrantTypes) > -1 ? 'checked' : '')%>> refresh
|
grantTypes) > -1 ? 'checked' : '')%>> refresh
|
||||||
</label>
|
</label>
|
||||||
-->
|
-->
|
||||||
<label class="checkbox">
|
<label class="checkbox">
|
||||||
<input id="authorizedGrantTypes-redelegate" type="checkbox" <%=($.inArray("urn:ietf:params:oauth:grant_type:redelegate",
|
<input id="grantTypes-redelegate" type="checkbox" <%=($.inArray("urn:ietf:params:oauth:grant_type:redelegate",
|
||||||
authorizedGrantTypes) > -1 ? 'checked' : '')%>> redelegate
|
grantTypes) > -1 ? 'checked' : '')%>> redelegate
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue