File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
share-oauth/src/main/java/org/sharextras/webscripts Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 9
9
import org .apache .commons .httpclient .HttpException ;
10
10
import org .apache .commons .httpclient .HttpMethod ;
11
11
import org .apache .commons .httpclient .methods .PostMethod ;
12
+ import org .apache .commons .logging .Log ;
13
+ import org .apache .commons .logging .LogFactory ;
12
14
import org .json .JSONException ;
13
15
import org .json .JSONObject ;
14
16
import org .json .JSONStringer ;
@@ -59,6 +61,8 @@ public class OAuthReturn extends AbstractWebScript
59
61
ConnectorService connectorService ;
60
62
String accessTokenUrl ;
61
63
64
+ private static Log logger = LogFactory .getLog (OAuthReturn .class );
65
+
62
66
/**
63
67
* Web Script constructor
64
68
*/
@@ -353,7 +357,17 @@ private Map<String, String> requestAccessToken(
353
357
}
354
358
else
355
359
{
356
- throw new WebScriptException (statusCode , "A problem occurred while requesting the access token" );
360
+ try
361
+ {
362
+ byte [] responseBody = method .getResponseBody ();
363
+ String tokenResp = new String (responseBody , Charset .forName ("UTF-8" ));
364
+ logger .error ("Request for access token returned " + statusCode + " response: " + tokenResp );
365
+ }
366
+ catch (IOException e )
367
+ {
368
+
369
+ }
370
+ throw new WebScriptException (statusCode , "A problem occurred while requesting the access token (code " + statusCode + ")" );
357
371
}
358
372
}
359
373
You can’t perform that action at this time.
0 commit comments