I'm trying to make a Slack App, using Bolt library.
I made a simple Hello World application according to official docs: https://api.slack.com/start/building/bolt-java
Credentials I inject from properties file, that's what my SlackApp class lookalike:
@Configuration
public class SlackApp {
private final String secret;
private final String token;
public SlackApp(@Value("${slack.signing-secret}") String secret,
@Value("${slack.bot-token}") String token) {
this.secret = secret;
this.token = token;
}
@Bean
public App initSlackApp() {
AppConfig config = AppConfig.builder()
.signingSecret(secret)
.singleTeamBotToken(token)
.build();
App app = new App(config);
app.command("/hello", (req, ctx) -> {
return ctx.ack("What's up?");
});
return app;
}
}
Token and secret, I've obtained like in this part of docs: https://slack.dev/java-slack-sdk/guides/getting-started-with-bolt
But when I try to turn on Event Subscription in Slack API I got Your URL didn't respond with the value of the challenge parameter. error.
And in application logs I've got
2021-11-30 17:27:08.364 DEBUG 81561 --- [nio-3000-exec-4] c.s.a.a.SlackSignature$Verifier : Request verification (timestamp: 1638278828, body: {"token":"VERIFICATION_TOKEN","challenge":"CHALLENGE","type":"url_verification"}, signature: v0=SIGNATURE)
2021-11-30 17:27:08.366 INFO 81561 --- [nio-3000-exec-4] c.s.a.b.m.builtin.RequestVerification : Invalid signature detected - v0=SIGNATURE
What can be reason of invalid signature error, if both signing secret and bot token is correct?