You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sn...@apache.org on 2014/01/30 02:20:43 UTC

[03/50] [abbrv] git commit: Added warnings for unexpected exceptions in OAUTH implementation.

Added warnings for unexpected exceptions in OAUTH implementation.


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/9fe5e718
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/9fe5e718
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/9fe5e718

Branch: refs/heads/USERGRID-2771-graph-edges
Commit: 9fe5e7189e026dc2ba1e1949353d05720548addc
Parents: a55b18f
Author: GERey <gr...@apigee.com>
Authored: Mon Jan 13 11:32:34 2014 -0800
Committer: GERey <gr...@apigee.com>
Committed: Mon Jan 13 11:32:34 2014 -0800

----------------------------------------------------------------------
 .../rest/applications/ApplicationResource.java     | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9fe5e718/stack/rest/src/main/java/org/usergrid/rest/applications/ApplicationResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/usergrid/rest/applications/ApplicationResource.java b/stack/rest/src/main/java/org/usergrid/rest/applications/ApplicationResource.java
index ac9420c..7143209 100644
--- a/stack/rest/src/main/java/org/usergrid/rest/applications/ApplicationResource.java
+++ b/stack/rest/src/main/java/org/usergrid/rest/applications/ApplicationResource.java
@@ -244,10 +244,7 @@ public class ApplicationResource extends ServiceResource {
                     errorDescription = "user disabled";
                 }
                 catch ( Exception e1 ) {
-                    logger.error( "Verification Error", e1 );
-                    OAuthResponse res = OAuthResponse.errorResponse( SC_INTERNAL_SERVER_ERROR ).setError(e1.getMessage()).buildJSONMessage();
-                    return Response.status( res.getResponseStatus() ).type( jsonMediaType( callback ) )
-                            .entity( wrapWithCallback( res.getBody(), callback ) ).build();
+                    logger.warn( "Unexpected exception during token username/password verification", e1 );
 
                 }
             }
@@ -256,10 +253,8 @@ public class ApplicationResource extends ServiceResource {
                     user = management.verifyAppUserPinCredentials( services.getApplicationId(), username, pin );
                 }
                 catch ( Exception e1 ) {
-                    logger.error( "Pin Verification Error", e1 );
-                    OAuthResponse res = OAuthResponse.errorResponse( SC_INTERNAL_SERVER_ERROR).setError(e1.getMessage()).buildJSONMessage();
-                    return Response.status( res.getResponseStatus() ).type( jsonMediaType( callback ) )
-                            .entity( wrapWithCallback( res.getBody(), callback ) ).build();
+                    logger.warn( "Unexpected exception during token pin verification", e1 );
+
                 }
             }
             else if ( "client_credentials".equals( grant_type ) ) {
@@ -271,10 +266,7 @@ public class ApplicationResource extends ServiceResource {
                     }
                 }
                 catch ( Exception e1 ) {
-                    logger.error( "Client Credentials Error", e1 );
-                    OAuthResponse res = OAuthResponse.errorResponse( SC_INTERNAL_SERVER_ERROR ).setError(e1.getMessage()).buildJSONMessage();
-                    return Response.status( res.getResponseStatus() ).type( jsonMediaType( callback ) )
-                            .entity( wrapWithCallback( res.getBody(), callback ) ).build();
+                    logger.warn( "Unexpected exception during token client authentication", e1 );
                 }
             }
 
@@ -465,6 +457,7 @@ public class ApplicationResource extends ServiceResource {
                 errorDescription = "user disabled";
             }
             catch ( Exception e1 ) {
+                logger.warn("Unexpected exception in authorize username/password verification", e1);
             }
 
             if ( ( user != null ) && isNotBlank( redirect_uri ) ) {