From f12d37f84e76d4f7f8df596c8e53bfeb07558d85 Mon Sep 17 00:00:00 2001 From: Justin Richer Date: Tue, 7 Oct 2014 18:24:51 -0400 Subject: [PATCH] added registration token rotation function to UI --- .../src/main/webapp/resources/js/client.js | 17 +++++++++++++++++ .../main/webapp/resources/template/client.html | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/client.js b/openid-connect-server-webapp/src/main/webapp/resources/js/client.js index 5b60dcf56..8218e0e32 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/client.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/client.js @@ -274,6 +274,23 @@ var ClientView = Backbone.View.extend({ $('#modalAlert .modal-body').html(_self.registrationTokenTemplate(savedModel)); + $('#modalAlert .modal-body #rotate-token').click(function(e) { + token.save(null, {success: function() { + console.log('token:' + token.get('value')); + $('#modalAlert .modal-body #registrationToken').val(token.get('value')); + }, + error: function() { + $('#modalAlert .modal-body').html('There was a problem rotating the registration access token for this client.'); + + $('#modalAlert').modal({ + 'backdrop': 'static', + 'keyboard': true, + 'show': true + }); + } + }); + }); + $('#modalAlert').modal({ 'backdrop': 'static', 'keyboard': true, diff --git a/openid-connect-server-webapp/src/main/webapp/resources/template/client.html b/openid-connect-server-webapp/src/main/webapp/resources/template/client.html index 3e61634b1..6d1192bec 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/template/client.html +++ b/openid-connect-server-webapp/src/main/webapp/resources/template/client.html @@ -759,4 +759,8 @@ +
+ +
+