Skip to content

Commit

Permalink
Merge pull request #1 from moults31/moults31/issue283-auth
Browse files Browse the repository at this point in the history
Fix Itiviti#283, move to new auth token format
  • Loading branch information
moults31 authored Oct 24, 2021
2 parents 9705580 + 4f337dc commit 4b92ccc
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import javax.websocket.WebSocketContainer;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.HttpHeaders;
import org.apache.http.NameValuePair;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
Expand Down Expand Up @@ -381,7 +382,9 @@ private void connectImpl() throws IOException
{
LOGGER.info("connecting to slack");
HttpClient httpClient = getHttpClient();
HttpGet request = new HttpGet(slackApiBase + "rtm.start?token=" + authToken);
HttpPost request = new HttpPost(slackApiBase + "rtm.start");
request.setHeader(HttpHeaders.CONTENT_TYPE,"application/x-www-form-urlencoded");
request.setHeader(HttpHeaders.AUTHORIZATION, "Bearer " + authToken);
HttpResponse response = httpClient.execute(request);
LOGGER.debug(response.getStatusLine().toString());
String jsonResponse = consumeToString(response.getEntity().getContent());
Expand Down

0 comments on commit 4b92ccc

Please sign in to comment.