|
|
@ -28,7 +28,10 @@ var ResRegClient = Backbone.Model.extend({
|
|
|
|
token_endpoint_auth_method:null,
|
|
|
|
token_endpoint_auth_method:null,
|
|
|
|
scope:null,
|
|
|
|
scope:null,
|
|
|
|
policy_uri:null,
|
|
|
|
policy_uri:null,
|
|
|
|
|
|
|
|
|
|
|
|
jwks_uri:null,
|
|
|
|
jwks_uri:null,
|
|
|
|
|
|
|
|
jwks:null,
|
|
|
|
|
|
|
|
jwksType:'URI',
|
|
|
|
|
|
|
|
|
|
|
|
application_type:null,
|
|
|
|
application_type:null,
|
|
|
|
registration_access_token:null,
|
|
|
|
registration_access_token:null,
|
|
|
@ -105,6 +108,16 @@ var ResRegRootView = Backbone.View.extend({
|
|
|
|
|
|
|
|
|
|
|
|
client.fetch({success: function() {
|
|
|
|
client.fetch({success: function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (client.get("jwks")) {
|
|
|
|
|
|
|
|
client.set({
|
|
|
|
|
|
|
|
jwksType: "VAL"
|
|
|
|
|
|
|
|
}, { silent: true });
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
client.set({
|
|
|
|
|
|
|
|
jwksType: "URI"
|
|
|
|
|
|
|
|
}, { silent: true });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var view = new ResRegEditView({model: client, systemScopeList: app.systemScopeList});
|
|
|
|
var view = new ResRegEditView({model: client, systemScopeList: app.systemScopeList});
|
|
|
|
|
|
|
|
|
|
|
|
view.load(function() {
|
|
|
|
view.load(function() {
|
|
|
@ -168,7 +181,8 @@ var ResRegEditView = Backbone.View.extend({
|
|
|
|
"click .btn-cancel":"cancel",
|
|
|
|
"click .btn-cancel":"cancel",
|
|
|
|
"click .btn-delete":"deleteClient",
|
|
|
|
"click .btn-delete":"deleteClient",
|
|
|
|
"change #logoUri input":"previewLogo",
|
|
|
|
"change #logoUri input":"previewLogo",
|
|
|
|
"change #tokenEndpointAuthMethod input:radio":"toggleClientCredentials"
|
|
|
|
"change #tokenEndpointAuthMethod input:radio":"toggleClientCredentials",
|
|
|
|
|
|
|
|
"change #jwkSelector input:radio":"toggleJWKSetType"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
cancel:function(e) {
|
|
|
|
cancel:function(e) {
|
|
|
@ -237,6 +251,25 @@ var ResRegEditView = Backbone.View.extend({
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Set up the form based on the JWK Set selector
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
toggleJWKSetType:function() {
|
|
|
|
|
|
|
|
var jwkSelector = $('#jwkSelector input:radio', this.el).filter(':checked').val();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (jwkSelector == 'URI') {
|
|
|
|
|
|
|
|
$('#jwksUri', this.el).show();
|
|
|
|
|
|
|
|
$('#jwks', this.el).hide();
|
|
|
|
|
|
|
|
} else if (jwkSelector == 'VAL') {
|
|
|
|
|
|
|
|
$('#jwksUri', this.el).hide();
|
|
|
|
|
|
|
|
$('#jwks', this.el).show();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$('#jwksUri', this.el).hide();
|
|
|
|
|
|
|
|
$('#jwks', this.el).hide();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
disableUnsupportedJOSEItems:function(serverSupported, query) {
|
|
|
|
disableUnsupportedJOSEItems:function(serverSupported, query) {
|
|
|
|
var supported = ['default'];
|
|
|
|
var supported = ['default'];
|
|
|
|
if (serverSupported) {
|
|
|
|
if (serverSupported) {
|
|
|
@ -282,6 +315,38 @@ var ResRegEditView = Backbone.View.extend({
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// process the JWKS
|
|
|
|
|
|
|
|
var jwksUri = null;
|
|
|
|
|
|
|
|
var jwks = null;
|
|
|
|
|
|
|
|
var jwkSelector = $('#jwkSelector input:radio', this.el).filter(':checked').val();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (jwkSelector == 'URI') {
|
|
|
|
|
|
|
|
jwksUri = $('#jwksUri input').val();
|
|
|
|
|
|
|
|
jwks = null;
|
|
|
|
|
|
|
|
} else if (jwkSelector == 'VAL') {
|
|
|
|
|
|
|
|
jwksUri = null;
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
jwks = JSON.parse($('#jwks textarea').val());
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
console.log("An error occurred when parsing the JWK Set");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Display an alert with an error message
|
|
|
|
|
|
|
|
$('#modalAlert div.modal-header').html("JWK Set Error");
|
|
|
|
|
|
|
|
$('#modalAlert div.modal-body').html("There was an error parsing the public key from the JSON Web Key set. Check the value and try again.");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#modalAlert").modal({ // wire up the actual modal functionality and show the dialog
|
|
|
|
|
|
|
|
"backdrop" : "static",
|
|
|
|
|
|
|
|
"keyboard" : true,
|
|
|
|
|
|
|
|
"show" : true // ensure the modal is shown immediately
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
jwksUri = null;
|
|
|
|
|
|
|
|
jwks = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var attrs = {
|
|
|
|
var attrs = {
|
|
|
|
client_name:$('#clientName input').val(),
|
|
|
|
client_name:$('#clientName input').val(),
|
|
|
|
logo_uri:$('#logoUri input').val(),
|
|
|
|
logo_uri:$('#logoUri input').val(),
|
|
|
@ -291,7 +356,8 @@ var ResRegEditView = Backbone.View.extend({
|
|
|
|
policy_uri: $('#policyUri input').val(),
|
|
|
|
policy_uri: $('#policyUri input').val(),
|
|
|
|
client_uri: $('#clientUri input').val(),
|
|
|
|
client_uri: $('#clientUri input').val(),
|
|
|
|
application_type: $('#applicationType input').filter(':checked').val(),
|
|
|
|
application_type: $('#applicationType input').filter(':checked').val(),
|
|
|
|
jwks_uri: $('#jwksUri input').val(),
|
|
|
|
jwks_uri: jwksUri,
|
|
|
|
|
|
|
|
jwks: jwks,
|
|
|
|
token_endpoint_auth_method: $('#tokenEndpointAuthMethod input').filter(':checked').val(),
|
|
|
|
token_endpoint_auth_method: $('#tokenEndpointAuthMethod input').filter(':checked').val(),
|
|
|
|
contacts: contacts,
|
|
|
|
contacts: contacts,
|
|
|
|
token_endpoint_auth_signing_alg: this.defaultToNull($('#tokenEndpointAuthSigningAlg select').val())
|
|
|
|
token_endpoint_auth_signing_alg: this.defaultToNull($('#tokenEndpointAuthSigningAlg select').val())
|
|
|
@ -310,6 +376,17 @@ var ResRegEditView = Backbone.View.extend({
|
|
|
|
// switch to an "edit" view
|
|
|
|
// switch to an "edit" view
|
|
|
|
app.navigate('dev/resource/edit', {trigger: true});
|
|
|
|
app.navigate('dev/resource/edit', {trigger: true});
|
|
|
|
_self.remove();
|
|
|
|
_self.remove();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (_self.model.get("jwks")) {
|
|
|
|
|
|
|
|
_self.model.set({
|
|
|
|
|
|
|
|
jwksType: "VAL"
|
|
|
|
|
|
|
|
}, { silent: true });
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
_self.model.set({
|
|
|
|
|
|
|
|
jwksType: "URI"
|
|
|
|
|
|
|
|
}, { silent: true });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var view = new ResRegEditView({model: _self.model, systemScopeList: _self.options.systemScopeList});
|
|
|
|
var view = new ResRegEditView({model: _self.model, systemScopeList: _self.options.systemScopeList});
|
|
|
|
|
|
|
|
|
|
|
|
view.load(function() {
|
|
|
|
view.load(function() {
|
|
|
@ -376,6 +453,7 @@ var ResRegEditView = Backbone.View.extend({
|
|
|
|
|
|
|
|
|
|
|
|
this.toggleClientCredentials();
|
|
|
|
this.toggleClientCredentials();
|
|
|
|
this.previewLogo();
|
|
|
|
this.previewLogo();
|
|
|
|
|
|
|
|
this.toggleJWKSetType();
|
|
|
|
|
|
|
|
|
|
|
|
// disable unsupported JOSE algorithms
|
|
|
|
// disable unsupported JOSE algorithms
|
|
|
|
this.disableUnsupportedJOSEItems(app.serverConfiguration.token_endpoint_auth_signing_alg_values_supported, '#tokenEndpointAuthSigningAlg option');
|
|
|
|
this.disableUnsupportedJOSEItems(app.serverConfiguration.token_endpoint_auth_signing_alg_values_supported, '#tokenEndpointAuthSigningAlg option');
|
|
|
|