Skip to content

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

Draft
WilliamBergamin wants to merge 3 commits into
mainfrom
standardized-auth
Draft

WilliamBergamin wants to merge 3 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 connects user accounts with the Slack-owned Connect and Manage connection controls. Rocket skates, anvils, and giant magnets not included.

  • Runs over Socket Mode, so it needs no public URL. Connections persist in a local properties file: a user is connected when their Slack user ID is in it.
  • Connect and Manage on the app profile send the user_connection event. The app answers within 3 seconds with apps.user.connection.requestAuth and the event's trigger_id, which opens the connection modal.
  • The auth_provider buttons use the fixed auth_provider_connect and auth_provider_disconnect action IDs. Both report the new state with requestAuth, which redraws an open modal, and refresh App Home.
  • user_connection_status_requested is answered with apps.user.connection.update.
  • App Home renders the auth_provider block.
  • The manifest subscribes to user_connection and user_connection_status_requested, which every app with features.user_connections needs.
  • Connecting in one click stands in for a real login. The README explains how to add an auth_url with a signed state.
  • Defines UserConnectionEvent, since the SDK has no model for user_connection yet.
  • Builds against 1.52.1-SNAPSHOT until java-slack-sdk releases appsUserConnectionRequestAuth, AuthProviderBlock, and UserConnectionStatusRequestedEvent (feat: add the user_connection_status_requested event model slackapi/java-slack-sdk#1660); CI fails until then.

Testing

In a workspace where standardized app authentication is available, with a Slack CLI newer than v4.10.0:

  1. Run slack run in standardized-auth.
  2. Open the app's Home tab and click Connect. Confirm the "Acme account" row shows Connected with your user ID.
  3. Click Disconnect and confirm the row shows Connect again.
  4. Open the app's profile and click Connect. Confirm the connection modal opens with no error toast, then click Connect in the modal and confirm it shows you as connected.
  5. Click Manage on the profile, then Disconnect in the modal, and confirm the modal and App Home both show Connect.
  6. As a user who has never opened the app, open its profile and confirm it shows Connect.

🤖 Generated with Claude Code

WilliamBergamin and others added 3 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant