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/23 17:55:59 UTC

cxf-fediz git commit: [FEDIZ-134] Updating the data manager to recognize refresh token scope requests

Repository: cxf-fediz
Updated Branches:
  refs/heads/master b241d3b5b -> 96d907f45


[FEDIZ-134] Updating the data manager to recognize refresh token scope requests


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

Branch: refs/heads/master
Commit: 96d907f4586f8310df84453d2b8a4c83bcf312b5
Parents: b241d3b
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Mon Nov 23 16:55:38 2015 +0000
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Mon Nov 23 16:55:38 2015 +0000

----------------------------------------------------------------------
 .../org/apache/cxf/fediz/service/oidc/OAuthDataManager.java  | 8 +++++++-
 .../src/main/webapp/WEB-INF/views/oAuthAuthorizationData.jsp | 7 ++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/96d907f4/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/OAuthDataManager.java
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/OAuthDataManager.java b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/OAuthDataManager.java
index d9d90fb..719c557 100644
--- a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/OAuthDataManager.java
+++ b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/OAuthDataManager.java
@@ -48,10 +48,14 @@ import org.apache.cxf.rs.security.oidc.utils.OidcUtils;
 public class OAuthDataManager extends AbstractCodeDataProvider {
 
     private static final OAuthPermission OPENID_PERMISSION;
+    private static final OAuthPermission REFRESH_TOKEN_PERMISSION;
     
     static {
-        OPENID_PERMISSION = new OAuthPermission(OidcUtils.OPENID_SCOPE, "Access the claims about the authentication");
+        OPENID_PERMISSION = new OAuthPermission(OidcUtils.OPENID_SCOPE, 
+            "Access the authentication claims");
         OPENID_PERMISSION.setDefault(true);
+        REFRESH_TOKEN_PERMISSION = new OAuthPermission(OAuthConstants.REFRESH_TOKEN_SCOPE, 
+            "Refresh access tokens");
     }
 
     private static Map<String, Client> clients = new ConcurrentHashMap<String, Client>();
@@ -67,6 +71,7 @@ public class OAuthDataManager extends AbstractCodeDataProvider {
     
     public OAuthDataManager() {
         permissionMap.put(OPENID_PERMISSION.getPermission(), OPENID_PERMISSION);
+        permissionMap.put(REFRESH_TOKEN_PERMISSION.getPermission(), REFRESH_TOKEN_PERMISSION);
     }
     
     public OAuthDataManager(Map<String, OAuthPermission> permissionMap) {
@@ -221,4 +226,5 @@ public class OAuthDataManager extends AbstractCodeDataProvider {
         this.tokenConverter = tokenConverter;
     }
 
+    
 }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/96d907f4/services/oidc/src/main/webapp/WEB-INF/views/oAuthAuthorizationData.jsp
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/webapp/WEB-INF/views/oAuthAuthorizationData.jsp b/services/oidc/src/main/webapp/WEB-INF/views/oAuthAuthorizationData.jsp
index 6468eed..9fe59b7 100644
--- a/services/oidc/src/main/webapp/WEB-INF/views/oAuthAuthorizationData.jsp
+++ b/services/oidc/src/main/webapp/WEB-INF/views/oAuthAuthorizationData.jsp
@@ -61,9 +61,14 @@
                                    .SESSION_AUTHENTICITY_TOKEN %>"
                                value="<%= data.getAuthenticityToken() %>"/>
                         <p><big><big><big>Would you like to grant <%= data.getApplicationName() %><br/>(<%= data.getApplicationDescription() %>)</big></big></big>
-                        
+                        <%
+                            if (data.getApplicationLogoUri() != null) {
+                        %> 
                         <br/><br/> 
                         <img src="<%= data.getApplicationLogoUri() %>" alt="Application Logo" width="100" height="100">
+                        <%
+                            }
+                        %>
                         <br/></p>
                         <big><big>the following permissions:<big/></big>
                         <p/>