Author: sergeyb
Date: Tue Nov 19 21:29:35 2013
New Revision: 1543582
URL: http://svn.apache.org/r1543582
Log:
Merged revisions 1543579 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1543579 | sergeyb | 2013-11-19 21:25:08 +0000 (Tue, 19 Nov 2013) | 1 line
[CXF-5402] Propagating the exceptions from the resource owner handler
........
Modified:
cxf/branches/2.7.x-fixes/ (props changed)
cxf/branches/2.7.x-fixes/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/ResourceOwnerGrantHandler.java
Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
Merged /cxf/trunk:r1543579
Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
cxf/branches/2.7.x-fixes/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/branches/2.7.x-fixes/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/ResourceOwnerGrantHandler.java?rev=1543582&r1=1543581&r2=1543582&view=diff
==============================================================================
---
cxf/branches/2.7.x-fixes/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/ResourceOwnerGrantHandler.java
(original)
+++
cxf/branches/2.7.x-fixes/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/owner/ResourceOwnerGrantHandler.java
Tue Nov 19 21:29:35 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,