File tree Expand file tree Collapse file tree
src/main/java/io/cdap/plugin/http/common/http Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ public static AccessToken getAccessTokenByClientCredentials(CloseableHttpClient
148148 new BasicNameValuePair ("grant_type" , OAuth2GrantType .CLIENT_CREDENTIALS .getValue ()));
149149 nameValuePairs .add (new BasicNameValuePair ("client_id" , config .getClientId ()));
150150 nameValuePairs .add (new BasicNameValuePair ("client_secret" , config .getClientSecret ()));
151- if (config .getScopes () != null ) {
151+ if (! Strings . isNullOrEmpty ( config .getScopes ()) ) {
152152 nameValuePairs .add (new BasicNameValuePair ("scope" , config .getScopes ()));
153153 }
154154 httppost = new HttpPost (uri );
@@ -157,7 +157,7 @@ public static AccessToken getAccessTokenByClientCredentials(CloseableHttpClient
157157 URIBuilder uriBuilder = new URIBuilder (config .getTokenUrl ()).setParameter ("client_id" ,
158158 config .getClientId ()).setParameter ("client_secret" , config .getClientSecret ())
159159 .setParameter ("grant_type" , OAuth2GrantType .CLIENT_CREDENTIALS .getValue ());
160- if (config .getScopes () != null ) {
160+ if (! Strings . isNullOrEmpty ( config .getScopes ()) ) {
161161 uriBuilder .setParameter ("scope" , config .getScopes ());
162162 }
163163 uri = uriBuilder .build ();
You can’t perform that action at this time.
0 commit comments