Skip to content

Commit

Permalink
fixed error when trying to login with Slack
Browse files Browse the repository at this point in the history
  • Loading branch information
albogdano committed Apr 26, 2021
1 parent d6484fe commit 57fc1e1
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class SlackAuthFilter extends AbstractAuthenticationProcessingFilter {

private final CloseableHttpClient httpclient;
private final ObjectReader jreader;
private static final String PROFILE_URL = "https://slack.com/api/users.identity?token={0}";
private static final String PROFILE_URL = "https://slack.com/api/users.identity";
private static final String TOKEN_URL = "https://slack.com/api/oauth.v2.access";
private static final String PAYLOAD = "code={0}&redirect_uri={1}&client_id={2}&client_secret={3}";

Expand Down Expand Up @@ -149,7 +149,8 @@ public UserAuthentication getOrCreateUser(App app, String accessToken) throws IO
UserAuthentication userAuth = null;
User user = new User();
if (accessToken != null) {
HttpGet profileGet = new HttpGet(Utils.formatMessage(PROFILE_URL, accessToken));
HttpGet profileGet = new HttpGet(PROFILE_URL);
profileGet.setHeader(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken);
profileGet.setHeader(HttpHeaders.ACCEPT, "application/json");
Map<String, Object> profile = null;

Expand Down

0 comments on commit 57fc1e1

Please sign in to comment.