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: Using OAuthUtils to inject MessageContext
Date Fri, 03 Mar 2017 11:19:30 GMT
Repository: cxf-fediz
Updated Branches:
  refs/heads/master 55131f929 -> 3f0c6be07


Using OAuthUtils to inject MessageContext


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

Branch: refs/heads/master
Commit: 3f0c6be0758622856158237466eef2fc9ec15732
Parents: 55131f9
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Fri Mar 3 11:19:15 2017 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Fri Mar 3 11:19:15 2017 +0000

----------------------------------------------------------------------
 .../cxf/fediz/service/oidc/OAuthDataProviderImpl.java     | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/3f0c6be0/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/OAuthDataProviderImpl.java
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/OAuthDataProviderImpl.java
b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/OAuthDataProviderImpl.java
index c265cef..888d70a 100644
--- a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/OAuthDataProviderImpl.java
+++ b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/OAuthDataProviderImpl.java
@@ -18,7 +18,6 @@
  */
 package org.apache.cxf.fediz.service.oidc;
 
-import java.lang.reflect.Method;
 import java.security.Principal;
 import java.util.Collections;
 import java.util.List;
@@ -29,6 +28,7 @@ import org.apache.cxf.rs.security.oauth2.common.OAuthPermission;
 import org.apache.cxf.rs.security.oauth2.grants.code.DefaultEHCacheCodeDataProvider;
 import org.apache.cxf.rs.security.oauth2.provider.OAuthServiceException;
 import org.apache.cxf.rs.security.oauth2.utils.OAuthConstants;
+import org.apache.cxf.rs.security.oauth2.utils.OAuthUtils;
 import org.apache.cxf.rs.security.oidc.utils.OidcUtils;
 
 public class OAuthDataProviderImpl extends DefaultEHCacheCodeDataProvider {
@@ -113,13 +113,7 @@ public class OAuthDataProviderImpl extends DefaultEHCacheCodeDataProvider
{
     public void setMessageContext(MessageContext mc) {
         super.setMessageContext(mc);
         if (authenticationStrategy != null) {
-            try {
-                Method contextMethod = authenticationStrategy.getClass().getMethod("setMessageContext",
-                                                                              new Class[]{MessageContext.class});
-                contextMethod.invoke(authenticationStrategy, new Object[]{mc});
-            } catch (Throwable t) {
-                // ignore
-            }    
+            OAuthUtils.injectContextIntoOAuthProvider(mc, authenticationStrategy);
         }
     }
 }


Mime
View raw message