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 update to the provider
Date Wed, 11 Nov 2015 16:48:59 GMT
Repository: cxf-fediz
Updated Branches:
  refs/heads/master 789d3fc38 -> 4e77ac075


[FEDIZ-134] Minor update to the provider


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

Branch: refs/heads/master
Commit: 4e77ac075880896f5beb3237b70a7c56b8c74986
Parents: 789d3fc
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Wed Nov 11 16:48:42 2015 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Wed Nov 11 16:48:42 2015 +0000

----------------------------------------------------------------------
 .../org/apache/cxf/fediz/service/oidc/OAuthDataManager.java   | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/4e77ac07/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 085ea54..b1e632e 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
@@ -86,8 +86,8 @@ public class OAuthDataManager extends AbstractCodeDataProvider {
         Principal principal = messageContext.getSecurityContext().getUserPrincipal();
         
         if (principal instanceof FedizPrincipal) {
-            grant.getSubject().getProperties().put("id_token", 
-                    getJoseIdToken((FedizPrincipal)principal, grant.getClient()));
+            String joseIdToken = getJoseIdToken((FedizPrincipal)principal, grant.getClient());
+            grant.getSubject().getProperties().put("id_token", joseIdToken);
         } else {
             throw new OAuthServiceException("Unsupported principal");
         }
@@ -105,6 +105,7 @@ public class OAuthDataManager extends AbstractCodeDataProvider {
                                                           client.getClientId());
         JwsJwtCompactProducer p = new JwsJwtCompactProducer(jwtClaims);
         return p.signWith(getJwsSignatureProvider(client));
+        // the JWS compact output may also need to be encrypted
     }
 
     protected JwsSignatureProvider getJwsSignatureProvider(Client client) {
@@ -113,7 +114,7 @@ public class OAuthDataManager extends AbstractCodeDataProvider {
             // HS256, HS384, HS512
             SignatureAlgorithm sigAlgo = JwsUtils.getSignatureAlgorithm(sigProps, 
                     SignatureAlgorithm.HS256); 
-            if (AlgorithmUtils.isHmacSign(sigAlgo.getJwaName())) {
+            if (AlgorithmUtils.isHmacSign(sigAlgo)) {
                 return JwsUtils.getHmacSignatureProvider(client.getClientSecret(), sigAlgo);
             }
         } 


Mime
View raw message