Skip to content

feat(standardized-auth): add an acme sample for standardized app auth - #95

Open
WilliamBergamin wants to merge 9 commits into
mainfrom
standardized-auth
Open

WilliamBergamin wants to merge 9 commits into
mainfrom
standardized-auth

Conversation

@WilliamBergamin

@WilliamBergamin WilliamBergamin commented Oct 16, 2026 •

Copy link
Copy Markdown

Summary

This pull request adds a standardized-auth sample: Acme, an app that lets users connect their account with Slack's built-in Connect and Manage connection controls. Rocket skates, anvils, and giant magnets not included.

  • App Home shows the connection with a Connect / Disconnect button.
  • Connect or Manage on the app's profile opens the connection modal.
  • When Slack asks whether a user is connected, the app answers.
  • Connecting takes one click, a stand-in for a real login. The README explains how to add your own sign-in page.
  • Runs over Socket Mode, so it needs no public URL, and saves connections to a local properties file.

Before merging

Needs Bolt for Java 1.53.0 to be released. The sample's CI job fails until then.

Testing

Use a workspace with standardized app authentication and Slack CLI v4.11.0 or newer.

  1. Run slack run in standardized-auth.
  2. On the app's Home tab, click Connect. The Acme row shows Connected. Click Disconnect and it shows Connect again.
  3. On the app's profile, click Connect. The modal opens with no error. Click Connect in the modal and it shows you as connected.
  4. On the profile, click Manage, then Disconnect. The modal and App Home both show Connect.
  5. As a user who has never opened the app, open its profile. It shows Connect.

🤖 Generated with Claude Code

WilliamBergamin and others added 9 commits October 16, 2026 12:22
Connects user accounts with the Slack-owned Connect and Manage connection
controls. Bolt's installation service holds each connection: the OAuth success
hook reports it with apps.user.connection.requestAuth, the disconnect
action forgets and revokes the user token, tokens_revoked forgets users
who remove the app, and the user_connection_status_requested event is
answered with apps.user.connection.update. App Home renders the
auth_provider block.

The user_connection request listener is written and tested but not yet
registered, since no Bolt routes that payload to action listeners yet.
This depends on java-slack-sdk 1.52.1-SNAPSHOT (AuthProviderBlock, the
new methods, and the status-requested event model) until it is released.
Match slack-samples/bolt-python-examples#305: run over Socket Mode, keep
connections in a local properties file, handle the user_connection event
and the fixed auth_provider_connect and auth_provider_disconnect action
IDs, and answer user_connection_status_requested. The OAuth flow,
installation service, tokens_revoked, and token revocation are gone.

The SDK has no user_connection event model yet, so the sample defines
UserConnectionEvent with a null default subtype to match Bolt's routing key.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Assert Bolt keys UserConnectionEvent as user_connection, and restore the
connections path before deleting the temp directory.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
… sample

The Java client returns ok:false responses without throwing, and Bolt logs
nothing at slf4j-simple's default INFO level, so a failed requestAuth left
no trace. Raise com.slack.api to debug so the SDK's DetailedLoggingListener
prints each call and its response, with the Authorization header redacted.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
…runs on

Note that slack run starts the app with mvn compile exec:java from the
start hook in .slack/hooks.json, and point to the debug logging config.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
java-slack-sdk#1660 now adds UserConnectionEvent, so drop the sample's
stand-in and its test. MainTest keeps the routing check that one listener
receives both the connect and disconnect subtypes.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Swap slf4j-simple for logback-classic 1.6.5 and copy the starter template's
logback.xml, which keeps com.slack.api at debug so every Slack API call and
its response is logged.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
The next java-slack-sdk minor ships requestAuth and the user_connection models. CI fails to resolve until 1.53.0 is on Maven Central.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@WilliamBergamin WilliamBergamin self-assigned this Oct 23, 2026
@WilliamBergamin WilliamBergamin added the enhancement New feature or request label Oct 23, 2026
@WilliamBergamin
WilliamBergamin marked this pull request as ready for review October 23, 2026 16:04
@WilliamBergamin
WilliamBergamin requested a review from a team as a code owner October 23, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant