cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf-fediz git commit: Updating the authorization form to check the earlier authorized scopes if any
Date Thu, 28 Jan 2016 21:21:33 GMT
Repository: cxf-fediz
Updated Branches:
  refs/heads/master 44ff5d629 -> 3a53baccd


Updating the authorization form to check the earlier authorized scopes if any


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

Branch: refs/heads/master
Commit: 3a53baccdeeeb690580cc54ffcc5c7207c408c31
Parents: 44ff5d6
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Thu Jan 28 21:21:05 2016 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Thu Jan 28 21:21:05 2016 +0000

----------------------------------------------------------------------
 services/oidc/src/main/webapp/WEB-INF/data-manager.xml   |  2 +-
 .../main/webapp/WEB-INF/views/oAuthAuthorizationData.jsp | 11 ++++++++---
 2 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/3a53bacc/services/oidc/src/main/webapp/WEB-INF/data-manager.xml
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/webapp/WEB-INF/data-manager.xml b/services/oidc/src/main/webapp/WEB-INF/data-manager.xml
index f5b70b3..d496731 100644
--- a/services/oidc/src/main/webapp/WEB-INF/data-manager.xml
+++ b/services/oidc/src/main/webapp/WEB-INF/data-manager.xml
@@ -49,7 +49,7 @@
         <property name="defaultScopes" ref="coreScopes"/>
         <property name="invisibleToClientScopes" ref="invisibleToClientScopes"/>
         <!--
-            <property name="supportPreauthorizedTokens" value="true"/>
+        <property name="supportPreauthorizedTokens" value="true"/>
         -->
         <!--
         <property name="accessTokenLifetime" value="3600"/>

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/3a53bacc/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 16404a8..1142d0f 100644
--- a/services/oidc/src/main/webapp/WEB-INF/views/oAuthAuthorizationData.jsp
+++ b/services/oidc/src/main/webapp/WEB-INF/views/oAuthAuthorizationData.jsp
@@ -1,7 +1,12 @@
-<%@ page import="javax.servlet.http.HttpServletRequest,org.apache.cxf.rs.security.oauth2.common.OAuthAuthorizationData,org.apache.cxf.rs.security.oauth2.common.Permission"
%>
+<%@ page import="javax.servlet.http.HttpServletRequest" %>
+<%@ page import="java.util.List" %>
+<%@ page import="org.apache.cxf.rs.security.oauth2.common.OAuthAuthorizationData" %>
+<%@ page import="org.apache.cxf.rs.security.oauth2.common.OAuthPermission" %>
+
 
 <%
     OAuthAuthorizationData data = (OAuthAuthorizationData)request.getAttribute("data");
+    List<String> authorizedScopes = data.getAlreadyAuthorizedPermissionsAsStrings();
 %>
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
@@ -72,13 +77,13 @@
 
                         <table> 
                             <%
-                               for (Permission perm : data.getPermissions()) {
+                               for (OAuthPermission perm : data.getAllPermissions()) {
                             %>
                                <tr>
                                 <td>
                                   <input type="checkbox" 
                                     <%
-                                      if (perm.isDefault()) {
+                                      if (perm.isDefault() || authorizedScopes.contains(perm.getPermission()))
{
                                     %>
                                     disabled="disabled"
                                     <%


Mime
View raw message