From 6df68fc97aaf045c79e42f6c7ecfef11ac37f610 Mon Sep 17 00:00:00 2001 From: Justin Richer Date: Mon, 9 Jun 2014 20:20:58 -0400 Subject: [PATCH] fixed client secret display on dynreg and res reg pages --- .../src/main/webapp/resources/js/dynreg.js | 2 +- .../src/main/webapp/resources/js/rsreg.js | 2 +- .../webapp/resources/template/dynreg.html | 20 ++++++++++++++--- .../main/webapp/resources/template/rsreg.html | 22 +++++++++++++++---- 4 files changed, 37 insertions(+), 9 deletions(-) diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/dynreg.js b/openid-connect-server-webapp/src/main/webapp/resources/js/dynreg.js index 3f9fe6d5e..66d57793b 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/dynreg.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/dynreg.js @@ -341,7 +341,7 @@ var DynRegEditView = Backbone.View.extend({ logo_uri:$('#logoUri input').val(), grant_types: grantTypes, scope: scopes, - + client_secret: null, // never send a client secret tos_uri: $('#tosUri input').val(), policy_uri: $('#policyUri input').val(), client_uri: $('#clientUri input').val(), diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/rsreg.js b/openid-connect-server-webapp/src/main/webapp/resources/js/rsreg.js index f99a16051..9c327a42f 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/rsreg.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/rsreg.js @@ -302,7 +302,7 @@ var ResRegEditView = Backbone.View.extend({ client_name:$('#clientName input').val(), logo_uri:$('#logoUri input').val(), scope: scopes, - + client_secret: null, // never send a client secret tos_uri: $('#tosUri input').val(), policy_uri: $('#policyUri input').val(), client_uri: $('#clientUri input').val(), diff --git a/openid-connect-server-webapp/src/main/webapp/resources/template/dynreg.html b/openid-connect-server-webapp/src/main/webapp/resources/template/dynreg.html index 504c1cd05..633b9ac36 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/template/dynreg.html +++ b/openid-connect-server-webapp/src/main/webapp/resources/template/dynreg.html @@ -67,8 +67,8 @@
- Warning! You MUST protect your Client ID, Client Secret, and your Registration Access Token. If - you lose your Client ID or Registration Access Token, you will no longer have access to your client's registration + Warning! You MUST protect your Client ID, Client Secret (if provided), and your Registration Access Token. + If you lose your Client ID or Registration Access Token, you will no longer have access to your client's registration records and you will need to register a new client.
@@ -87,7 +87,21 @@
-
<%=client.client_id ? (client.client_secret ? client.client_secret : 'None (public client)') : 'Will be generated'%>
+ <% if (client.client_id) { %> + <% if (client.client_secret) { %> +
<%= client.client_secret %>
+ <% } else { %> + <% if (client.token_endpoint_auth_method == 'none') { %> +
None (public client)
+ <% } else if (client.token_endpoint_auth_method == 'private_key_jwt') { %> +
None (private key authentication)
+ <% } else { %> +

Unknown error: no client secret and unknown auth method.

+ <% } %> + <% } %> + <% } else { %> +
Will be generated
+ <% } %>
diff --git a/openid-connect-server-webapp/src/main/webapp/resources/template/rsreg.html b/openid-connect-server-webapp/src/main/webapp/resources/template/rsreg.html index 7436c4f8e..3aa65b7cf 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/template/rsreg.html +++ b/openid-connect-server-webapp/src/main/webapp/resources/template/rsreg.html @@ -65,9 +65,9 @@
- Warning! You MUST protect your resource ID, Secret, and your Registration Access Token. If - you lose your ID or Registration Access Token, you will no longer have access to your resource's registration - records and you will need to register a new resource. + Warning! You MUST protect your Client ID, Client Secret (if provided), and your Registration Access Token. + If you lose your Client ID or Registration Access Token, you will no longer have access to your client's registration + records and you will need to register a new client.
@@ -85,7 +85,21 @@
-
<%=client.client_id ? (client.client_secret ? client.client_secret : 'None (public client)') : 'Will be generated'%>
+ <% if (client.client_id) { %> + <% if (client.client_secret) { %> +
<%= client.client_secret %>
+ <% } else { %> + <% if (client.token_endpoint_auth_method == 'none') { %> +
None (public client)
+ <% } else if (client.token_endpoint_auth_method == 'private_key_jwt') { %> +
None (private key authentication)
+ <% } else { %> +

Unknown error: no client secret and unknown auth method.

+ <% } %> + <% } %> + <% } else { %> +
Will be generated
+ <% } %>