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: [FEDIZ-134] Minor updates to the scopes properties
Date Tue, 10 Nov 2015 13:46:17 GMT
Repository: cxf-fediz
Updated Branches:
  refs/heads/master e32d70d4d -> be1904a44


[FEDIZ-134] Minor updates to the scopes properties


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

Branch: refs/heads/master
Commit: be1904a44cfb2b71ab53a18a8b1a7d7d05c98029
Parents: e32d70d
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Tue Nov 10 13:46:00 2015 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Tue Nov 10 13:46:00 2015 +0000

----------------------------------------------------------------------
 .../apache/cxf/fediz/service/oidc/OAuthDataManager.java | 12 ++++++++----
 .../oidc/src/main/webapp/WEB-INF/applicationContext.xml | 10 +++++-----
 2 files changed, 13 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/be1904a4/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 2e802da..15ead2c 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
@@ -38,13 +38,14 @@ import org.apache.cxf.rs.security.oauth2.grants.code.ServerAuthorizationCodeGran
 import org.apache.cxf.rs.security.oauth2.provider.OAuthServiceException;
 import org.apache.cxf.rs.security.oauth2.tokens.refresh.RefreshToken;
 import org.apache.cxf.rs.security.oauth2.utils.OAuthConstants;
+import org.apache.cxf.rs.security.oidc.utils.OidcUtils;
 
 public class OAuthDataManager extends AbstractCodeDataProvider {
 
     private static final OAuthPermission OPENID_PERMISSION;
     
     static {
-        OPENID_PERMISSION = new OAuthPermission("openid", "OIDC Authentication");
+        OPENID_PERMISSION = new OAuthPermission(OidcUtils.OPENID_SCOPE, "Access the claims
about the authentication");
         OPENID_PERMISSION.setDefault(true);
     }
 
@@ -157,10 +158,13 @@ public class OAuthDataManager extends AbstractCodeDataProvider {
         this.tokenConverter = tokenConverter;
     }
 
-    public void setExtraScopes(Map<String, String> extraScopes) {
+    public void setScopes(Map<String, String> extraScopes) {
         for (Map.Entry<String, String> entry : extraScopes.entrySet()) {
-            permissionMap.put(entry.getKey(), 
-                    new OAuthPermission(entry.getKey(), entry.getValue()));
+            OAuthPermission permission = new OAuthPermission(entry.getKey(), entry.getValue());
+            if (OidcUtils.OPENID_SCOPE.equals(entry.getKey())) {
+                permission.setDefault(true);
+            }
+            permissionMap.put(entry.getKey(), permission);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/be1904a4/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 142b7c7..20044c0 100644
--- a/services/oidc/src/main/webapp/WEB-INF/applicationContext.xml
+++ b/services/oidc/src/main/webapp/WEB-INF/applicationContext.xml
@@ -83,13 +83,13 @@
      </jaxrs:server>
      
     <bean id="oauthProvider" class="org.apache.cxf.fediz.service.oidc.OAuthDataManager">
-        <!--
-        <property name="extraScopes">
+    <!--
+        <property name="scopes">
           <map>
             <entry key="scopeName" value="scopeDescription" />
-	  </map>
-	</property>
-	-->
+          </map>
+        </property>
+    -->
     </bean>
     
 </beans>


Mime
View raw message