cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject [1/3] cxf git commit: [CXF-6561, CXF-6562] Checking a null subject in ResourceOwnerGrantHandler, patch from Karl von Randow applied with minor updates, This closes #83
Date Thu, 27 Aug 2015 16:39:13 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes dbfbbbbf2 -> e525c7701


[CXF-6561, CXF-6562] Checking a null subject in ResourceOwnerGrantHandler, patch from Karl
von Randow applied with minor updates, This closes #83


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

Branch: refs/heads/3.0.x-fixes
Commit: e525c7701c9665d8bd37dbc39694b22f330b9a60
Parents: b097710
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Thu Aug 27 17:28:04 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Thu Aug 27 17:38:38 2015 +0100

----------------------------------------------------------------------
 .../grants/owner/ResourceOwnerGrantHandler.java     | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/e525c770/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/ResourceOwnerGrantHandler.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/ResourceOwnerGrantHandler.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/ResourceOwnerGrantHandler.java
index d7f6c33..58718b8 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/ResourceOwnerGrantHandler.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/ResourceOwnerGrantHandler.java
@@ -47,13 +47,17 @@ public class ResourceOwnerGrantHandler extends AbstractGrantHandler {
             throw new OAuthServiceException(
                  new OAuthError(OAuthConstants.INVALID_REQUEST));
         }
-        
-        UserSubject subject = loginHandler.createSubject(ownerName, ownerPassword);
-        
-        if (subject == null) {
-            throw new OAuthServiceException(OAuthConstants.INVALID_GRANT);
+        UserSubject subject = null;
+        try {
+            subject = loginHandler.createSubject(ownerName, ownerPassword);
+            if (subject == null) {
+                throw new OAuthServiceException(OAuthConstants.INVALID_GRANT);
+            }
+        } catch (OAuthServiceException ex) { 
+            throw ex;
+        } catch (Exception ex) { 
+            throw new OAuthServiceException(OAuthConstants.INVALID_GRANT, ex);
         }
-        
         return doCreateAccessToken(client, 
                                    subject,
                                    params);


Mime
View raw message