Browse Source

updated display of saved client secret

pull/618/head
Justin Richer 11 years ago
parent
commit
04de4e8483
  1. 30
      openid-connect-server-webapp/src/main/webapp/resources/js/client.js
  2. 6
      openid-connect-server-webapp/src/main/webapp/resources/template/client.html

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

@ -686,9 +686,27 @@ var ClientFormView = Backbone.View.extend({
var generateClientSecret = $('#generateClientSecret input').is(':checked');
var clientSecret = null;
var tokenEndpointAuthMethod = $('#tokenEndpointAuthMethod input').filter(':checked').val();
// whether or not the client secret changed
var secretChanged = false;
if (tokenEndpointAuthMethod == 'SECRET_BASIC'
|| tokenEndpointAuthMethod == 'SECRET_POST'
|| tokenEndpointAuthMethod == 'SECRET_JWT') {
if (!generateClientSecret) {
// if it's required but we're not generating it, send the value to preserve it
clientSecret = $('#clientSecret input').val();
// if it's not the same as before, offer to display it
if (clientSecret != this.model.get('clientSecret')) {
secretChanged = true;
}
} else {
// it's being generated anew
secretChanged = true;
}
}
var accessTokenValiditySeconds = null;
@ -729,15 +747,13 @@ var ClientFormView = Backbone.View.extend({
allowRefresh: $('#allowRefresh').is(':checked'),
allowIntrospection: $('#allowIntrospection input').is(':checked'), // <-- And here? --^
scope: scopes,
// TODO: items below this line are untested
tosUri: $('#tosUri input').val(),
policyUri: $('#policyUri input').val(),
clientUri: $('#clientUri input').val(),
applicationType: $('#applicationType input').filter(':checked').val(),
jwksUri: $('#jwksUri input').val(),
subjectType: $('#subjectType input').filter(':checked').val(),
tokenEndpointAuthMethod: $('#tokenEndpointAuthMethod input').filter(':checked').val(),
tokenEndpointAuthMethod: tokenEndpointAuthMethod,
responseTypes: responseTypes,
sectorIdentifierUri: $('#sectorIdentifierUri input').val(),
initiateLoginUri: $('#initiateLoginUri input').val(),
@ -784,7 +800,13 @@ var ClientFormView = Backbone.View.extend({
$('#modalAlertLabel').html('Client Saved');
$('#modalAlert .modal-body').html(_self.clientSavedTemplate(_self.model.toJSON()));
var savedModel = {
clientId: _self.model.get('clientId'),
clientSecret: _self.model.get('clientSecret'),
secretChanged: secretChanged
};
$('#modalAlert .modal-body').html(_self.clientSavedTemplate(savedModel));
$('#modalAlert .modal-body #savedClientSecret').hide();

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

@ -702,11 +702,15 @@
<strong>ID:</strong> <input type="text" readonly style="cursor: text" class="token-full input-xxlarge" value="<%= clientId %>" />
</div>
<% if (generateClientSecret && clientSecret != null && clientSecret != '') { %>
<% if (secretChanged) { %>
<div>
<strong>Secret:</strong> <button class="btn btn-mini" id="clientSaveShow">Show Secret</button>
<input type="text" id="savedClientSecret" readonly style="cursor: text" class="token-full input-xxlarge" value="<%= clientSecret %>" />
</div>
<% } else if (clientSecret == null || clientSecret == '') { %>
<div>
<i>No client secret</i>
</div>
<% } else { %>
<div>
<strong>Secret:</strong> <i>unchanged</i>

Loading…
Cancel
Save