Browse Source

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
commit
26483b22a9
  1. 19
      openid-connect-server-webapp/src/main/webapp/resources/js/client.js
  2. 19
      openid-connect-server-webapp/src/main/webapp/resources/js/dynreg.js
  3. 2
      openid-connect-server-webapp/src/main/webapp/resources/js/locale/en/messages.json
  4. 8
      openid-connect-server-webapp/src/main/webapp/resources/template/client.html
  5. 8
      openid-connect-server-webapp/src/main/webapp/resources/template/dynreg.html

19
openid-connect-server-webapp/src/main/webapp/resources/js/client.js

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

19
openid-connect-server-webapp/src/main/webapp/resources/js/dynreg.js

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

2
openid-connect-server-webapp/src/main/webapp/resources/js/locale/en/messages.json

@ -103,6 +103,8 @@
"redelegation": "redelegation",
"redirect-uris": "Redirect URI(s)",
"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-tokens": "Refresh Tokens",
"refresh-tokens-issued": "Refresh tokens are issued for this client",

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

@ -742,7 +742,13 @@
</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>
<div class="controls">
</div>

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

@ -527,7 +527,13 @@
</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>
<div class="controls">
</div>

Loading…
Cancel
Save