cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1562516 - in /cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services: AbstractOAuthService.java AbstractTokenService.java
Date Wed, 29 Jan 2014 17:24:35 GMT
Author: sergeyb
Date: Wed Jan 29 17:24:34 2014
New Revision: 1562516

URL: http://svn.apache.org/r1562516
Log:
[CXF-5530] Support for providers overriding the error message in case of the missing clients

Modified:
    cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractOAuthService.java
    cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java

Modified: cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractOAuthService.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractOAuthService.java?rev=1562516&r1=1562515&r2=1562516&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractOAuthService.java
(original)
+++ cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractOAuthService.java
Wed Jan 29 17:24:34 2014
@@ -117,6 +117,10 @@ public abstract class AbstractOAuthServi
         reportInvalidRequestError(error, mt);
     }
     
+    protected void reportInvalidRequestError(OAuthError entity) {
+        reportInvalidRequestError(entity, MediaType.APPLICATION_JSON_TYPE);
+    }
+    
     protected void reportInvalidRequestError(OAuthError entity, MediaType mt) {
         ResponseBuilder rb = Response.status(400);
         if (mt != null) {

Modified: cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java?rev=1562516&r1=1562515&r2=1562516&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java
(original)
+++ cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java
Wed Jan 29 17:24:34 2014
@@ -129,7 +129,10 @@ public class AbstractTokenService extend
         try {
             client = getValidClient(clientId);
         } catch (OAuthServiceException ex) {
-            // log it
+            if (ex.getError() != null) {
+                reportInvalidRequestError(ex.getError());
+                return null;
+            }
         }
         if (client == null) {
             reportInvalidRequestError("Client ID is invalid");



Mime
View raw message