version 1.10.0
New Features
Sign in with Slack (OpenID Connect)
Sign in with Slack helps users log into your service using their Slack profile. The platform feature was recently upgraded to be compatible with the standard OpenID Connect specification. With Bolt for Java v1.10 or higher, implementing the auth flow is much easier.
The following app is a simple example demonstrating how to handle the OpenID Connect flow with Bolt in Kotlin:
import com.auth0.jwt.JWT
import com.slack.api.bolt.App
import com.slack.api.bolt.jetty.SlackAppServer
fun main() {
val app = App().asOpenIDConnectApp(true)
app.openIDConnectSuccess { request, response, token ->
val claims = JWT.decode(token.idToken).claims
request.context.logger.info("id_token claims: {}", claims)
// Store the data in your database
// Redirect the user to the next step
response.statusCode = 302
response.headers["Location"] = listOf("https://slack.com/")
response
}
val apps = mutableMapOf("/slack/" to app)
val server = SlackAppServer(apps)
server.start() // http://localhost:3000/slack/install
// export SLACK_CLIENT_ID=
// export SLACK_CLIENT_SECRET=
// export SLACK_USER_SCOPES=openid,email,profile
// export SLACK_INSTALL_PATH=install
// export SLACK_REDIRECT_URI_PATH=oauth_redirect
// export SLACK_REDIRECT_URI=https://{your-domain-here}/slack/oauth_redirect
// gradle run
}
Refer to the document for more details.
Changes
- [bolt] #795 #796 Add "Sign in with Slack (OpenID Connect)" support - Thanks @seratch
- [slack-api-model] #801 Fix #759 by adding common fields in Block Kit model interfaces - Thanks @janjanneck @seratch
- [slack-api-client] #790 #785 A video link posted in a channel, causes a IllegalStateException for Conversation history API call - Thanks @sitamarn @seratch
- [slack-api-client] #784 #791 MessageDeletedEvent Java bug when a threaded message with Tombstone us deleted - Thanks @EnricoVoss @seratch
- [slack-api-client] #807 Improve the error caused in the #792 scenario - Thanks @seratch
- [slack-api-client] #794 Add email_password_policy_enabled to admin.users.invite API arguments - Thanks @seratch
- [all] #797 #770 Bump external dependency versions in v1.9 - Thanks @seratch
- [project] #793 Link to contributing and maintainer guides from README - Thanks @filmaj
- [tests] #800 Significantly improve the stability of the unit tests in CI builds - Thanks @filmaj
- All issues/pull requests: https://github.com/slackapi/java-slack-sdk/milestone/36?closed=1
- All changes: v1.9.0...v1.10.0