You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2015/11/12 17:39:41 UTC

cxf-fediz git commit: [FEDIZ-134] Starting moving the JWS configuration to the external file

Repository: cxf-fediz
Updated Branches:
  refs/heads/master 4e77ac075 -> 3aab9a328


[FEDIZ-134] Starting moving the JWS configuration to the external file


Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/3aab9a32
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/3aab9a32
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/3aab9a32

Branch: refs/heads/master
Commit: 3aab9a32823f401b7eacfc27220d2e28ad97d9dc
Parents: 4e77ac0
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Thu Nov 12 16:39:18 2015 +0000
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Thu Nov 12 16:39:18 2015 +0000

----------------------------------------------------------------------
 .../service/oidc/ClientRegistrationService.java |  9 ++++---
 .../src/main/resources/rs.security.properties   | 25 ++++++++++++++++++++
 .../main/webapp/WEB-INF/applicationContext.xml  |  6 +++++
 .../src/main/webapp/WEB-INF/views/consumers.jsp |  2 +-
 .../webapp/WEB-INF/views/registerClient.jsp     |  8 +++----
 5 files changed, 40 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/3aab9a32/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRegistrationService.java
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRegistrationService.java b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRegistrationService.java
index cafe39a..983845d 100644
--- a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRegistrationService.java
+++ b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRegistrationService.java
@@ -67,11 +67,10 @@ public class ClientRegistrationService {
                                  @FormParam("appType") String appType,
                                  @FormParam("redirectURI") String redirectURI) {
         String clientId = generateClientId();
-        //String clientSecret = 
-        //    "confidential".equals(appType) ? generateClientSecret() : null;
-        String clientSecret = generateClientSecret();
-    
-        Client newClient = new Client(clientId, clientSecret, true, appName, null);
+        boolean isConfidential = "confidential".equals(appType);
+        String clientSecret = isConfidential ? generateClientSecret() : null;
+        
+        Client newClient = new Client(clientId, clientSecret, isConfidential, appName, null);
         newClient.setApplicationDescription(appDesc);
         newClient.setRedirectUris(Collections.singletonList(redirectURI));
         

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/3aab9a32/services/oidc/src/main/resources/rs.security.properties
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/resources/rs.security.properties b/services/oidc/src/main/resources/rs.security.properties
new file mode 100644
index 0000000..4a2b608
--- /dev/null
+++ b/services/oidc/src/main/resources/rs.security.properties
@@ -0,0 +1,25 @@
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License. You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied. See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+
+#rs.security.keystore.type=jks
+#rs.security.keystore.password=password
+#rs.security.keystore.alias=alice
+#rs.security.keystore.file=org/apache/cxf/systest/jaxrs/security/certs/alice.jks
+#rs.security.encryption.content.algorithm=A128GCM
+#rs.security.encryption.key.algorithm=RSA-OAEP
+#rs.security.signature.algorithm=RS256
+rs.security.signature.algorithm=none

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/3aab9a32/services/oidc/src/main/webapp/WEB-INF/applicationContext.xml
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/webapp/WEB-INF/applicationContext.xml b/services/oidc/src/main/webapp/WEB-INF/applicationContext.xml
index 7b5f660..5586c93 100644
--- a/services/oidc/src/main/webapp/WEB-INF/applicationContext.xml
+++ b/services/oidc/src/main/webapp/WEB-INF/applicationContext.xml
@@ -36,6 +36,12 @@
         <jaxrs:providers>
             <ref bean="viewProvider"/>
         </jaxrs:providers>
+        <jaxrs:properties>
+            <entry key="rs.security.signature.properties" value="rs.security.properties"/>
+            <!--
+            <entry key="rs.security.signature.key.password.provider" value-ref="keyPasswordProvider"/>
+            -->
+        </jaxrs:properties>
     </jaxrs:server>
     
     <jaxrs:server address="/client">

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/3aab9a32/services/oidc/src/main/webapp/WEB-INF/views/consumers.jsp
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/webapp/WEB-INF/views/consumers.jsp b/services/oidc/src/main/webapp/WEB-INF/views/consumers.jsp
index 21b77ac..9f53713 100644
--- a/services/oidc/src/main/webapp/WEB-INF/views/consumers.jsp
+++ b/services/oidc/src/main/webapp/WEB-INF/views/consumers.jsp
@@ -25,7 +25,7 @@
 <em></em>
 <br/>
 <table border="1">
-    <tr><th><big><big>Client Name</big></big></th><th><big><big>Client Identifier</big></big></th><th><big><big>Client Secret</big></big></th><th><big><big>PreAuthorized Token</big></big></th><th><big><big>PreAuthorized Code</big></big></th></tr> 
+    <tr><th><big><big>Client Name</big></big></th><th><big><big>Client Identifier</big></big></th><th><big><big>Client Secret</big></big></th></tr> 
     <%
        for (Consumer entry : regs.getConsumers()) {
     %>

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/3aab9a32/services/oidc/src/main/webapp/WEB-INF/views/registerClient.jsp
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/webapp/WEB-INF/views/registerClient.jsp b/services/oidc/src/main/webapp/WEB-INF/views/registerClient.jsp
index 530a9da..c6b0ff3 100644
--- a/services/oidc/src/main/webapp/WEB-INF/views/registerClient.jsp
+++ b/services/oidc/src/main/webapp/WEB-INF/views/registerClient.jsp
@@ -27,7 +27,7 @@
            method="POST">
        <table>    
         <tr>
-            <td><big><big><big>API Client Name:</big></big></big></td>
+            <td><big><big><big>Client Name:</big></big></big></td>
             <td>
               <input type="text" name="appName" size="50" value="API Client"/>
             </td>
@@ -36,7 +36,7 @@
             <td colspan="2">&nbsp;</td>
         </tr>
         <tr>
-            <td><big><big><big>API Client Description:</big></big></big></td>
+            <td><big><big><big>Client Description:</big></big></big></td>
             <td>
               <input type="text" size="50" name="appDescription" 
                      value="API Service Client"/>
@@ -46,10 +46,10 @@
             <td colspan="2">&nbsp;</td>
         </tr>
         <tr>
-            <td><big><big><big>API Client Type:</big></big></big></td>
+            <td><big><big><big>Client Type:</big></big></big></td>
             <td>
                <select name="appType">
-				  <option value="confidential">Confidential</option>
+				  <option value="confidential" selected>Confidential</option>
 				  <option value="public">Public</option>
 				</select> 
             </td>