Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2014-08-08 00:52:42 +0000
committerRoberto E. Escobar2014-09-29 22:55:11 +0000
commitacdecb8e095a65dc7c7772ba67fec7ec6b008043 (patch)
treea823215b17c7e165e81db4b258b19e107b0536ed
parentc0e8cb4799714839d357772bb1aaa12f8342f2e0 (diff)
downloadorg.eclipse.osee-acdecb8e095a65dc7c7772ba67fec7ec6b008043.tar.gz
org.eclipse.osee-acdecb8e095a65dc7c7772ba67fec7ec6b008043.tar.xz
org.eclipse.osee-acdecb8e095a65dc7c7772ba67fec7ec6b008043.zip
refinement: Authorization code null check in JaxRsClient
-rw-r--r--plugins/org.eclipse.osee.jaxrs.client/src/org/eclipse/osee/jaxrs/client/internal/ext/OAuth2Flows.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/org.eclipse.osee.jaxrs.client/src/org/eclipse/osee/jaxrs/client/internal/ext/OAuth2Flows.java b/plugins/org.eclipse.osee.jaxrs.client/src/org/eclipse/osee/jaxrs/client/internal/ext/OAuth2Flows.java
index f4754999e80..7d6e527cc94 100644
--- a/plugins/org.eclipse.osee.jaxrs.client/src/org/eclipse/osee/jaxrs/client/internal/ext/OAuth2Flows.java
+++ b/plugins/org.eclipse.osee.jaxrs.client/src/org/eclipse/osee/jaxrs/client/internal/ext/OAuth2Flows.java
@@ -83,8 +83,11 @@ public class OAuth2Flows {
}
if (response.isOobAuthorization()) {
- ClientAccessToken token =
- exchangeCodeForToken(sessionCookie, response.getAuthorizationCode(), state, scope, redirectUri);
+ String authorizationCode = response.getAuthorizationCode();
+ if (!Strings.isValid(authorizationCode)) {
+ throw newException("Authorization code was null");
+ }
+ ClientAccessToken token = exchangeCodeForToken(sessionCookie, authorizationCode, state, scope, redirectUri);
if (Strings.isValid(tokenValidationUri)) {
validateToken(response.getAuthenticityCookie(), token);
}

Back to the top