You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2013/11/19 22:25:08 UTC
svn commit: r1543579 -
/cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/ResourceOwnerGrantHandler.java
Author: sergeyb
Date: Tue Nov 19 21:25:08 2013
New Revision: 1543579
URL: http://svn.apache.org/r1543579
Log:
[CXF-5402] Propagating the exceptions from the resource owner handler
Modified:
cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/ResourceOwnerGrantHandler.java
Modified: cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/ResourceOwnerGrantHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/ResourceOwnerGrantHandler.java?rev=1543579&r1=1543578&r2=1543579&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/ResourceOwnerGrantHandler.java (original)
+++ cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/ResourceOwnerGrantHandler.java Tue Nov 19 21:25:08 2013
@@ -21,6 +21,7 @@ package org.apache.cxf.rs.security.oauth
import javax.ws.rs.core.MultivaluedMap;
import org.apache.cxf.rs.security.oauth2.common.Client;
+import org.apache.cxf.rs.security.oauth2.common.OAuthError;
import org.apache.cxf.rs.security.oauth2.common.ServerAccessToken;
import org.apache.cxf.rs.security.oauth2.common.UserSubject;
import org.apache.cxf.rs.security.oauth2.grants.AbstractGrantHandler;
@@ -43,14 +44,17 @@ public class ResourceOwnerGrantHandler e
String ownerName = params.getFirst(OAuthConstants.RESOURCE_OWNER_NAME);
String ownerPassword = params.getFirst(OAuthConstants.RESOURCE_OWNER_PASSWORD);
if (ownerName == null || ownerPassword == null) {
- throw new OAuthServiceException(OAuthConstants.INVALID_REQUEST);
+ throw new OAuthServiceException(
+ new OAuthError(OAuthConstants.INVALID_REQUEST));
}
UserSubject subject = null;
try {
subject = loginHandler.createSubject(ownerName, ownerPassword);
+ } catch (RuntimeException ex) {
+ throw ex;
} catch (Exception ex) {
- throw new OAuthServiceException(OAuthConstants.INVALID_REQUEST);
+ throw new OAuthServiceException(OAuthConstants.INVALID_GRANT, ex);
}
return doCreateAccessToken(client,