added claims redirect URI editing to the UI for both admins and dynamic clients, closes #1005

pull/1016/head
Justin Richer 9 years ago
parent c386f0d7c1
commit 26483b22a9

@ -83,6 +83,8 @@ var ClientModel = Backbone.Model.extend({
resourceIds:[], resourceIds:[],
//additionalInformation? //additionalInformation?
claimsRedirectUris:[],
clientDescription:"", clientDescription:"",
reuseRefreshToken:true, reuseRefreshToken:true,
clearAccessTokensOnRefresh:true, clearAccessTokensOnRefresh:true,
@ -619,6 +621,7 @@ var ClientFormView = Backbone.View.extend({
this.defaultAcrValuesCollection = new Backbone.Collection(); this.defaultAcrValuesCollection = new Backbone.Collection();
this.requestUrisCollection = new Backbone.Collection(); this.requestUrisCollection = new Backbone.Collection();
this.postLogoutRedirectUrisCollection = new Backbone.Collection(); this.postLogoutRedirectUrisCollection = new Backbone.Collection();
this.claimsRedirectUrisCollection = new Backbone.Collection();
// TODO: add Spring authorities collection and resource IDs collection? // TODO: add Spring authorities collection and resource IDs collection?
// collection of sub-views that need to be sync'd on save // collection of sub-views that need to be sync'd on save
@ -988,6 +991,7 @@ var ClientFormView = Backbone.View.extend({
sectorIdentifierUri: sectorIdentifierUri, sectorIdentifierUri: sectorIdentifierUri,
initiateLoginUri: $('#initiateLoginUri input').val(), initiateLoginUri: $('#initiateLoginUri input').val(),
postLogoutRedirectUris: this.postLogoutRedirectUrisCollection.pluck('item'), postLogoutRedirectUris: this.postLogoutRedirectUrisCollection.pluck('item'),
claimsRedirectUris: this.claimsRedirectUrisCollection.pluck('item'),
reuseRefreshToken: $('#reuseRefreshToken').is(':checked'), reuseRefreshToken: $('#reuseRefreshToken').is(':checked'),
clearAccessTokensOnRefresh: $('#clearAccessTokensOnRefresh').is(':checked'), clearAccessTokensOnRefresh: $('#clearAccessTokensOnRefresh').is(':checked'),
requireAuthTime: $('#requireAuthTime input').is(':checked'), requireAuthTime: $('#requireAuthTime input').is(':checked'),
@ -1136,9 +1140,22 @@ var ClientFormView = Backbone.View.extend({
placeholder: 'https://', placeholder: 'https://',
helpBlockText: $.t('client.client-form.post-logout-help'), helpBlockText: $.t('client.client-form.post-logout-help'),
collection: this.postLogoutRedirectUrisCollection}); collection: this.postLogoutRedirectUrisCollection});
$('#postLogoutRedirectUri .controls', this.el).html(postLogoutRedirectUrisView.render().el); $('#postLogoutRedirectUris .controls', this.el).html(postLogoutRedirectUrisView.render().el);
this.listWidgetViews.push(postLogoutRedirectUrisView); this.listWidgetViews.push(postLogoutRedirectUrisView);
// build and bind claims redirect URIs
_.each(this.model.get('claimsRedirectUris'), function(claimsRedirectUri) {
_self.claimsRedirectUrisCollection.add(new URIModel({item:claimsRedirectUri}));
});
var claimsRedirectUrisView = new ListWidgetView({
type: 'uri',
placeholder: 'https://',
helpBlockText: $.t('client.client-form.claims-redirect-uris-help'),
collection: this.claimsRedirectUrisCollection});
$('#claimsRedirectUris .controls', this.el).html(claimsRedirectUrisView.render().el);
this.listWidgetViews.push(claimsRedirectUrisView);
// build and bind request URIs // build and bind request URIs
_.each(this.model.get('requestUris'), function (requestUri) { _.each(this.model.get('requestUris'), function (requestUri) {
_self.requestUrisCollection.add(new URIModel({item:requestUri})); _self.requestUrisCollection.add(new URIModel({item:requestUri}));

@ -57,6 +57,8 @@ var DynRegClient = Backbone.Model.extend({
initiate_login_uri:null, initiate_login_uri:null,
post_logout_redirect_uris:null, post_logout_redirect_uris:null,
claims_redirect_uris:[],
request_uris:[], request_uris:[],
registration_access_token:null, registration_access_token:null,
@ -191,6 +193,7 @@ var DynRegEditView = Backbone.View.extend({
this.defaultAcrValuesCollection = new Backbone.Collection(); this.defaultAcrValuesCollection = new Backbone.Collection();
this.requestUrisCollection = new Backbone.Collection(); this.requestUrisCollection = new Backbone.Collection();
this.postLogoutRedirectUrisCollection = new Backbone.Collection(); this.postLogoutRedirectUrisCollection = new Backbone.Collection();
this.claimsRedirectUrisCollection = new Backbone.Collection();
this.listWidgetViews = []; this.listWidgetViews = [];
}, },
@ -458,6 +461,7 @@ var DynRegEditView = Backbone.View.extend({
sector_identifier_uri: sectorIdentifierUri, sector_identifier_uri: sectorIdentifierUri,
initiate_login_uri: $('#initiateLoginUri input').val(), initiate_login_uri: $('#initiateLoginUri input').val(),
post_logout_redirect_uris: this.postLogoutRedirectUrisCollection.pluck('item'), post_logout_redirect_uris: this.postLogoutRedirectUrisCollection.pluck('item'),
claims_redirect_uris: this.claimsRedirectUrisCollection.pluck('item'),
require_auth_time: $('#requireAuthTime input').is(':checked'), require_auth_time: $('#requireAuthTime input').is(':checked'),
default_max_age: parseInt($('#defaultMaxAge input').val()), default_max_age: parseInt($('#defaultMaxAge input').val()),
contacts: contacts, contacts: contacts,
@ -592,9 +596,22 @@ var DynRegEditView = Backbone.View.extend({
placeholder: 'https://', placeholder: 'https://',
helpBlockText: $.t('client.client-form.post-logout-help'), helpBlockText: $.t('client.client-form.post-logout-help'),
collection: this.postLogoutRedirectUrisCollection}); collection: this.postLogoutRedirectUrisCollection});
$('#postLogoutRedirectUri .controls', this.el).html(postLogoutRedirectUrisView.render().el); $('#postLogoutRedirectUris .controls', this.el).html(postLogoutRedirectUrisView.render().el);
this.listWidgetViews.push(postLogoutRedirectUrisView); this.listWidgetViews.push(postLogoutRedirectUrisView);
// build and bind claims redirect URIs
_.each(this.model.get('claimsRedirectUris'), function(claimsRedirectUri) {
_self.claimsRedirectUrisCollection.add(new URIModel({item:claimsRedirectUri}));
});
var claimsRedirectUrisView = new ListWidgetView({
type: 'uri',
placeholder: 'https://',
helpBlockText: $.t('client.client-form.claims-redirect-uris-help'),
collection: this.claimsRedirectUrisCollection});
$('#claimsRedirectUris .controls', this.el).html(claimsRedirectUrisView.render().el);
this.listWidgetViews.push(claimsRedirectUrisView);
// build and bind request URIs // build and bind request URIs
_.each(this.model.get('request_uris'), function (requestUri) { _.each(this.model.get('request_uris'), function (requestUri) {
_self.requestUrisCollection.add(new URIModel({item:requestUri})); _self.requestUrisCollection.add(new URIModel({item:requestUri}));

@ -103,6 +103,8 @@
"redelegation": "redelegation", "redelegation": "redelegation",
"redirect-uris": "Redirect URI(s)", "redirect-uris": "Redirect URI(s)",
"redirect-uris-help": "URIs that the client can be redirected to after the authorization page", "redirect-uris-help": "URIs that the client can be redirected to after the authorization page",
"claims-redirect-uris": "Claims Redirect URI(s)",
"claims-redirect-uris-help": "URIs that the client can be redirected to after the claims gathering flow",
"refresh": "refresh", "refresh": "refresh",
"refresh-tokens": "Refresh Tokens", "refresh-tokens": "Refresh Tokens",
"refresh-tokens-issued": "Refresh tokens are issued for this client", "refresh-tokens-issued": "Refresh tokens are issued for this client",

@ -742,7 +742,13 @@
</div> </div>
</div> </div>
<div class="control-group" id="postLogoutRedirectUri"> <div class="control-group" id="claimsRedirectUris">
<label class="control-label" data-i18n="client.client-form.claims-redirect-uris">Claims Redirect URI(s)</label>
<div class="controls">
</div>
</div>
<div class="control-group" id="postLogoutRedirectUris">
<label class="control-label"><span class="label label-default nyi"><i class="icon-road icon-white"></i> NYI </span> <span data-i18n="client.client-form.post-logout">Post-Logout Redirect</span></label> <label class="control-label"><span class="label label-default nyi"><i class="icon-road icon-white"></i> NYI </span> <span data-i18n="client.client-form.post-logout">Post-Logout Redirect</span></label>
<div class="controls"> <div class="controls">
</div> </div>

@ -527,7 +527,13 @@
</div> </div>
</div> </div>
<div class="control-group" id="postLogoutRedirectUri"> <div class="control-group" id="claimsRedirectUris">
<label class="control-label" data-i18n="client.client-form.claims-redirect-uris">Claims Redirect URI(s)</label>
<div class="controls">
</div>
</div>
<div class="control-group" id="postLogoutRedirectUris">
<label class="control-label"><span class="label label-default nyi"><i class="icon-road icon-white"></i> NYI </span> <span data-i18n="client.client-form.post-logout">Post-Logout Redirect</span></label> <label class="control-label"><span class="label label-default nyi"><i class="icon-road icon-white"></i> NYI </span> <span data-i18n="client.client-form.post-logout">Post-Logout Redirect</span></label>
<div class="controls"> <div class="controls">
</div> </div>

Loading…
Cancel
Save